[Rpm-maint] [rpm-software-management/rpm] Implement one-shot macro modifier <o> (PR #4169)

Michal Domonkos notifications at github.com
Mon Apr 20 08:34:52 UTC 2026


@dmnks commented on this pull request.



> @@ -63,7 +63,17 @@ Macro behavior can be altered by supplying modifiers: (Added: 6.1.0)
 	_NAME_*<*_MODIFIERS_*>* _BODY_
 
 Supported modifiers are:
-- *l*iteral - macro body is literal, *%* is not processed when expanding
+- *l*: Literal expansion. *%* is not processed when expanding.
+- *o*: One-shot expansion. The macro is expanded on first use and the
+  literal result is pushed on top of the original macro.

> The stacked nature of the macro engine is explained in DESCRIPTION, and understanding that is necessary to understanding this modifier, because you can rearm the expansion by doing an undefine.

You're right, my bad.

The note about stacking doesn't use the term "push" (it does mention "pop" though). So maybe we could adjust it to something like this (bold is new):

> RPM macros are stacked, ie. when redefining an already existing macro, it shadows **(is pushed on top of)** the previous definition instead of replacing it, and undefining a macro only pops the topmost definition, thus activating the previous macro definition.

Or, we could adjust the new text instead:

> The macro is expanded on first use and the literal result is pushed on top of **(shadows)** the original macro.

Not sure if it's clearer that way, though. But the word "push" I feel like should be clarified...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4169?email_source=notifications&email_token=ADLPZUYZWWIYZYCNSUNDCKD4WXOKZA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIMJTHA2DGOJZGYYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOS6XA4S7OJSXM2LFO5PW433UNFTGSY3BORUW63TTL5RWY2LDNM#discussion_r3109298955
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4169/review/4138439960 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260420/1581617b/attachment-0001.htm>


More information about the Rpm-maint mailing list