[Rpm-maint] [rpm-software-management/rpm] Describe conditionally expanded macros in manual (#786)

Michael Schroeder notifications at github.com
Wed Jul 10 10:00:42 UTC 2019


mlschroe commented on this pull request.



> +Frequently used conditionally expanded macros are e.g.
+Define a macro if it is not defined:
+\verbatim
+%{?!with_python3: %global with_python3 1}
+\endverbatim
+A macro that is expanded to 1 if "with_python3" is defined and 0 otherwise:
+\verbatim
+%{?with_python3:1}%{!?with_python3:0}
+\endverbatim
+or shortly
+\verbatim
+0%{!?with_python3:1}
+\endverbatim
+
+%"{?macro_name}" is a shortcut for "%{?macro_name:%macro_name}" and
+similarly "%{?!macro_name}" is a shortcut for "%{?!marco_name:%macro_name}"

That's actually not true: `%{?!marco_name}` always expands to an empty string:
```
$ rpm --eval '%{?!xxx}'

$ rpm --eval '%{?!xxx:%xxx}'
%xxx
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/786#pullrequestreview-259991106
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190710/0fd63892/attachment.html>


More information about the Rpm-maint mailing list