[Rpm-maint] [rpm-software-management/rpm] Add a man page for rpm macro processor (PR #3781)
Michal Domonkos
notifications at github.com
Fri Jun 13 14:27:39 UTC 2025
@dmnks commented on this pull request.
> +
+Note that the *%[expression]* expansion is different to the
+*%{expr:expression}* macro. With the latter, the macros in the
+expression are expanded first and then the expression is
+evaluated (without re-expanding the terms). Thus
+
+```
+rpm --define 'foo 1 + 2' --eval '%{expr:%foo}'
+```
+
+will print *3*. Using *%[%foo]* instead will result in the
+error that "1 + 2" is not a number.
+
+Doing the macro expansion when evaluating the terms has two
+advantages. First, it allows rpm to do correct short-circuit
+processing when evaluation logical operators. Second, the
evaluating
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3781#pullrequestreview-2925034020
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3781/review/2925034020 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250613/9f0b3a12/attachment.htm>
More information about the Rpm-maint
mailing list