[Rpm-maint] [rpm-software-management/rpm] Macro arguments do not support quoting (#222)

Jeff Johnson notifications at github.com
Fri Aug 3 13:36:17 UTC 2018


(after looking at recent changes to macro expansion)

Parameterized macros use posix getopt(3) for parsing macro options/arguments, and getopt is perfectly capable of honoring quoting similar to bash.

Sadly the implementation in rpm does not use getopt argv but attempts its own parser in order to expand each macro argument individually, honoring not only quoting, but also %(...) diversions, %{...} macro scoping, and (most painful of all to get right for positional args) empty arguments that expand to "".

The parser in rpmio/macro.c needs fixing to handle quoting (without the ugly %{quote: ...} construct), as well as the possibility that a single parameterized macro argument may lead to multiple arguments to pass to getopt(3) some of which may need quoting (because empty or having white space embedded) before being executed.



-- 
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/222#issuecomment-410249134
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180803/b3a93b8d/attachment.html>


More information about the Rpm-maint mailing list