diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2013-01-22 07:55:11 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2013-01-29 08:14:38 +0200 |
commit | cca565fd10665cfb6fe7f875fc0d079e0f56a913 (patch) | |
tree | 7a939088567e1481c79454650b2e77b3f02de5e4 | |
parent | a409565d320dae872dc652a11c1674d397c4d945 (diff) | |
download | rpm-cca565fd10665cfb6fe7f875fc0d079e0f56a913.tar.gz rpm-cca565fd10665cfb6fe7f875fc0d079e0f56a913.tar.bz2 rpm-cca565fd10665cfb6fe7f875fc0d079e0f56a913.zip |
Make double-quoting work for special %doc (and %license) too
- Up to now, special %doc has been different from everything else in
%files: double-quoting which is used to escape eg spaces in filenames
has not worked, but single-quoting and backslash-escapes (which do
not work elsewhere in %files) "worked" by happenstance due to getting
passed verbatim to shell/cp. Those and various other %doc hacks people
have come with stopped working (ticket #858) as starting from
commit 29677605d44dc9cba3119135653ba0372ab58037 we perform the
copies in slightly more controlled manner.
- Rather than re-enable old quirks, make %doc and %license behavior
consistent with the rest of the %files section: double-quoting and
globs work, other escaping methods do not.
- This does mean a minor (as docs with spaces are relatively rare)
compatibility rift in specs, the "official workaround" is that
if compatibility with older rpm versions is required globs can
be used instead of quotation.
(cherry picked from commit a1d9364adb556813886d91b2799217a412ac5bb0)
-rw-r--r-- | build/files.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/build/files.c b/build/files.c index 10d7fffd7..4a8cb563e 100644 --- a/build/files.c +++ b/build/files.c @@ -1762,10 +1762,13 @@ static void processSpecialDir(rpmSpec spec, Package pkg, FileList fl, appendLineStringBuf(docScript, mkdocdir); for (ARGV_const_t fn = sd->files; fn && *fn; fn++) { + /* Quotes would break globs, escape spaces instead */ + char *efn = rpmEscapeSpaces(*fn); appendStringBuf(docScript, "cp -pr "); - appendStringBuf(docScript, *fn); + appendStringBuf(docScript, efn); appendStringBuf(docScript, " $"); appendLineStringBuf(docScript, sdenv); + free(efn); } if (install) { |