[Rpm-maint] [rpm-software-management/rpm] Use full build template (#480)

Jeff Johnson notifications at github.com
Mon Jul 30 20:34:02 UTC 2018


There is an alternative, arguably better approach, to restoring only a single macro expansion point:

  Don't expand scriptlet bodies when parsing from spec file sections.

Delaying macro expansion restores the single expansion point without a need for escaping.

Delayed expansion also permits overrides of macros used in templates outside of spec file parsing, and also would remove the need to store parsed sections internally to rpm. Instead the relevant scriptlet section body would just be defined in the macro dictionary to be retrieved through template expansion.

There are some subtleties that would need to be decided. First is that the macro dictionary is dynamic because of %define etc, and the dictionary while parsing can be different than the dictionary at template expansion. Second is that %if handling and macro expansion order would change, with %if being performed before rather than after macro expansion.

One can creat parsing pathology test cases for either the current or the delayed expansion approaches



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/480#issuecomment-409000638
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180730/76e6724e/attachment-0001.html>


More information about the Rpm-maint mailing list