Skip to content
Discussion options

You must be logged in to vote

A %define is 100% declarative, nothing is expanded at the time of definition. This is a hugely important aspect of it, eg to ensure macro files can be read without side-effects.

Shell expansions are in no way special, so yes they're re-executed at the time of use. Sometimes this is what you want (eg inside parametric macros), sometimes it's not (eg the above examples). And yeah that's exactly what the "avoid re-expansion of expensive macros" refers to. The problem of %global is that it conflates two different issues: scope and time of expansion. For the expansive subshell stuff you'd really want one-shot time of use semantics instead - see #1155.

I'll reply to the Fedora thread separately…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ferdnyc
Comment options

You must be logged in to vote
2 replies
@ferdnyc
Comment options

@ferdnyc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants