[Rpm-maint] [rpm-software-management/rpm] Implement a table-like shortcut to rpm macros in Lua (#1398)

nim-nim notifications at github.com
Wed Oct 14 09:42:55 UTC 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201014/9ab283bb/attachment-0001.html>


More information about the Rpm-maint mailing list