- 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)
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) {