[Rpm-maint] [rpm-software-management/rpm] Shell-like escaping support in %files (PR #1903)

Michal Domonkos notifications at github.com
Fri Mar 18 10:22:41 UTC 2022


@dmnks commented on this pull request.



> @@ -665,6 +665,20 @@ void rpmUnescape(char *s)
     *p = '\0';
 }
 
+void rpmUnescapeQuotes(char *s)
+{
+    char *p, *q;
+    int esc = 0;
+    p = q = s;
+    while (*q != '\0') {
+	*p = *q++;
+	esc = (*p == '\\') && !esc && *q == '"';

> In the interest of avoiding confusion, I suggest reporting an error if you encounter them. Rejecting unescaped backslashes would also be a good idea; they are considered bad practice in shell scripts.

Fair enough.

> Why are partially quoted words syntax errors? That means that quotes and globs cannot be mixed, which is annoying.

Well, RPM currently only supports the basic form of quotation, which is `"/foo"`, i.e. an opening and closing quote at the very beginning and end of the line, respectively. What do you mean by "quotes and globs cannot be mixed"? Can you provide an example?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1903#discussion_r829869138
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/1903/review/914180296 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220318/b69cc18a/attachment.html>


More information about the Rpm-maint mailing list