[Rpm-maint] [rpm-software-management/rpm] Implement -e(xpand) and -g(lobal) options to %define (PR #4194)

Panu Matilainen notifications at github.com
Tue Apr 28 08:28:09 UTC 2026


%define -eg is identical to %global, but separate options allows for finer control.

Annoyingly we need to parse the options manually because we get this as a free-form string instead of argv array, and we can't parse it into an argv array with eg poptParseArgvString() because we the body must not be split on whitespace. We could get just the options that way, but then we'd need to parse through the options to locate name start anyhow. This also doesn't help implement options for other ME_PARSE macros, but that can always be refactored later.

It'd be trivial to support modifiers as %define options as well, but as the reverse is not true (in particular, body expansion must not be available for macro files), perhaps it's best to not overlap at all.

Fixes: #4163
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/4194

-- Commit Summary --

  * Implement -e(xpand) and -g(lobal) options to %define

-- File Changes --

    M docs/man/rpm-macros.7.scd (19)
    M rpmio/macro.cc (41)
    M tests/rpmmacro.at (75)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/4194.patchhttps://github.com/rpm-software-management/rpm/pull/4194.diff
-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4194
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4194 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260428/d02267c9/attachment.htm>


More information about the Rpm-maint mailing list