[Rpm-maint] [rpm-software-management/rpm] Implement immutable macro modifier (PR #4171)
Panu Matilainen
notifications at github.com
Thu Apr 2 08:13:51 UTC 2026
Immutable macros cannot be redefined or undefined, so they make it possible to lock macro values in place. They are compatible with regular, parametric and literal macros, but not one-shot macros because they use stacking.
RPM itself needs to be redefine and undefine anything at all to guarantee operation, so this is enforced at "user" level macro defines and undefines only. It might seem more reasonable to have the "force" flag for overriding immutable checks default to false, but it would require updating way more callers throughout the codebase, so this looks like the better option, at least for now.
Take advantage of the immutable flag to remove other special casing for built-in macros.
Fixes: #2314
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/4171?email_source=notifications&email_token=ADLPZU7FVLGYIPXA2OBNDXD4TYOL7A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTIOBRGAYTGOBXGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVVYHEX3POBSW4X3DNRUWG2Y
-- Commit Summary --
* Render macro modifiers in --showrc output
* Implement one-shot macro modifier <o>
* Return result codes from the low-level push/pop macro functions
* Implement immutable macro modifier
* Flag built-in macros immutable
-- File Changes --
M docs/man/rpm-macros.7.scd (37)
M include/rpm/rpmmacro.h (1)
M rpmio/macro.cc (110)
M tests/rpmmacro.at (140)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/4171.patch?email_source=notifications&email_token=ADLPZU463YJMXAW6CEIDUFT4TYOL7A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTIOBRGAYTGOBXGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZYHEX3QMF2GG2C7MNWGSY3Lhttps://github.com/rpm-software-management/rpm/pull/4171.diff?email_source=notifications&email_token=ADLPZUZ2H5R6OFKE2KNMQXT4TYOL7A5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF4ZTIOBRGAYTGOBXGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVVYHEX3ENFTGMX3DNRUWG2Y
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4171
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/4171 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260402/19a93778/attachment-0001.htm>
More information about the Rpm-maint
mailing list