[Rpm-maint] [rpm-software-management/rpm] RFE: optional one-shot/cached macro expansion (#1155)
Panu Matilainen
notifications at github.com
Thu Feb 19 12:04:55 UTC 2026
pmatilai left a comment (rpm-software-management/rpm#1155)
Discussed the syntax with @dmnks today and came up with a solution that fits nicely into the macro file syntax, and since it works there it can be also used in %define/%global without any further code: add an optional `<modifiers>` field to the syntax, eg:
`%_pyver<o> %(python3 --version)`
It combines without parametrics too:
`%mymacro(ab:f)<c> ....`
We could also support long names (perhaps later on), eg
`%mymacro<oneshot,const> ...`
"const" is a work-in-progress name for #2314 which suffers from the same issue: the implementation is easy enough, the syntax has been the blocker.
`<>` is used for the modifier because `[]` we might one day want to use that for arrays, and `{}` is already used in the macro body, so this makes these stand out. In the long name version, `,` is the separator to avoid confusion with parametric arguments using `:` and space is what separates the name part from the body, so spaces seem unappropriate.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1155#issuecomment-3926835775
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/1155/3926835775 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260219/708af832/attachment.htm>
More information about the Rpm-maint
mailing list