From cca565fd10665cfb6fe7f875fc0d079e0f56a913 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 22 Jan 2013 07:55:11 +0200 Subject: 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) --- build/files.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3