[Rpm-maint] [rpm-software-management/rpm] RFE: please add a way to get the unexpanded content of a rpm variable (#582)

nim-nim notifications at github.com
Sun Oct 28 10:19:30 UTC 2018


As seen in
https://github.com/rpm-software-management/rpm/issues/581

when you want to write some variable definition to a macro file, it gets expanded by rpm. That usually does not matter but unfortunately, in some cases, you really really want the expansion to occur when the file definition is evaluated later, and not at the time you write this file (for example, in fedora-release, you don’t want the `%{?distprefix}` in `%{dist}` to be evaluated by the fedora-release spec, but by the other specs that read it).

You can more or less workaround this by peppering your macro definitions with `%`s before writing to the file but:

* the syntax is awkward, tricky to write and maintain
* that makes the result unusable in the spec that writes the macro file, so you you end up writing the same definition twice, once with added `%`s for the macro file and once without them for the spec itself. And as a result you introduce potential bug if someone forgets to update both definitions at the same time

Please add a syntax construct (and its lua equivalent like rpm.expand) to access first-level, unexpanded rpm variable contents.

-- 
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/issues/582
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20181028/731269f3/attachment.html>


More information about the Rpm-maint mailing list