Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve literal value of quoted paths in %files
Turn off the special meaning of metacharacters within a filename enclosed in quotes, just like a typical shell does it. Do it by automatically escaping such chars at parse time, as that internally reduces the case to the one where the spec author does the escaping manually (i.e. fewer code paths to worry about). This will also allow us to implement partial quoting (e.g. /foo"*") in the future if we so choose. Currently, only fully quoted filenames are supported. This is an extension of the original (and possibly misleading) quotation semantics that was only meant for whitespace escaping. It's backward compatible since globs never worked correctly when used in a quoted filename anyway, due to rpmGlob() splitting them by whitespace and globbing the parts separately. This was only fixed recently in commit 4030062 but hasn't yet been released, so no spec files in production are really expected to be using such filenames. Make the newly added rpmEscapeChars() accept either a string of chars to escape or a function, with the latter allowing the use of isspace(3) which is locale-dependent in rpmEscapeSpaces(). For ease of use, expose the string variant as rpmEscape(), though.
- Loading branch information
Showing
5 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters