[Rpm-maint] [rpm-software-management/rpm] Collapse unexpanded macro definitions (#1198) (#1343)

Michal Domonkos notifications at github.com
Tue Aug 25 09:57:25 UTC 2020


> Technically %define and %global can appear anywhere at all in the spec, not just beginning of line

OK, true. One example: `%{!?foo:%define foo ...}` For some reason, this didn't occur to me, sigh...

In that case, I agree it doesn't make sense to specifically handle the "beginning of line" case only. That's not a systemic solution, just a band-aid.

> Another twist is that unlike %define, the body of the %global is expanded at the time of definition, which means that a %global macro defined in the spec itself with an %if is always broken (wrt the %if in spec context).

Wait, isn't the distinction between those two macros about the time their *bodies* get expanded? I mean, both macros *are* expanded at definition time, it's just that the body of a `%define` is itself only expanded when actually used, right? Just to re-iterate - expanding a `%define` or `%global` macro means introducing the macro that's being defined into the respective (local or global) namespace.

-- 
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/1343#issuecomment-679928150
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200825/c07fdffb/attachment.html>


More information about the Rpm-maint mailing list