Looking back on my code, I see it required both the expanded and non expanded 
variants. The general case is expansion (recursively, till there is nothing 
else to process). However in less frequent but tricky cases expanding can be 
premature and you really need to pass things as is (I've come to think of those 
as pointers/references to stuff that can not be expanded till later when the 
data context is populated enough for expansion to succeed).

However in the non expanded case you still need to test for macro existence, so 
non expanded is not a plain %{?foo} but %{?foo} if foo exists and nil otherwise.

If there is an expanded vs non expanded variant I’d suggest making the expanded 
variant fully expanded and interpreted, ie re-expanding till there is nothing 
more to expand, stripping quoted lines, stripping empty lines, real booleans, 
multi-line values represented as a table of values.

The advantage of a fully expanded variant is that you kill all the macro 
heisenbugs where initial unit testing is fine but field use fails because 
packagers stack macros and stacking adds levels of expansion not tested against 
initially.

-- 
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/1398#issuecomment-708288190
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to