[Rpm-maint] [rpm-software-management/rpm] Properly quote %sources and %patches (#1781)

Panu Matilainen notifications at github.com
Wed Sep 22 07:54:16 UTC 2021


Adding the single quotes seems like a no-brainer on the outset, but when you need to escape them, it opens a different can of worms: macro use is not limited to shell, only there's no way to tell (rhymes nicely, no? :laughing: ) and can occur outside the spec as well (the number of backslashes seems to suggest a backslash-eating spec-context at work, didn't check though).

We of course do have numerous shell-only macros, but I'm not sure %patches and %sources are such by definition. At the very least, they are not the only place where quoting and consequent escaping might be needed - eg, what about single %{PATCH5} or %{SOURCE1} with funky characters in them?
So it seems to me we should have a generic helper macro for quoting (with escapes) for the shell.
Perhaps %patches and %sources deserve/need to be shell-only, but I'm not entirely convinced this is a safe assumption.

-- 
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/1781#issuecomment-924677321
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210922/41b71c9e/attachment.html>


More information about the Rpm-maint mailing list