Ticket #858 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

%doc macro no longer handles files with spaces in their names using \ to quote.

Reported by: opoplawski Assigned to: pmatilai Priority: major Milestone: rpm-4.11.0 Component: rpm Version: RPM Development Keywords: Cc:


With rpm 4.11.0-0.beta1.1.fc19:

%doc doc/Users\ guide\ Apache.html

Gets executed as:

+ cp -pr 'doc/Users /builddir/build/BUILDROOT/rubygem-passenger-3.0.19-1.fc19.i386/usr/share/doc/mod_passenger-3.0.19'
cp: missing destination file operand after 'doc/Users /builddir/build/BUILDROOT/rubygem-passenger-3.0.19-1.fc19.i386/usr/share/doc/mod_passenger-3.0.19'


%doc 'doc/Users guide Apache.html'

doesn't work either:

+ cp -pr 'doc/Users $DOCDIR
cp -pr guide $DOCDIR
cp -pr Apache.html' /builddir/build/BUILDROOT/rubygem-passenger-3.0.19-1.fc19.x86_64/usr/share/doc/mod_passenger-3.0.19
cp: cannot stat 'doc/Users $DOCDIR\ncp -pr guide $DOCDIR\ncp -pr Apache.html': No such file or directory

Change History

01/21/13 15:33:42 changed by pmatilai

  • owner changed from RpmTickets to pmatilai.

Hmph... this is quite an ugly mess.

Single-quotation and backslash-escaping only ever "worked" in %doc by happenstance, they aren't *supposed* to work, and do not work in %files. What makes it so ugly is that the "official" way of double-quoting has (AFAICT) never worked for special %doc files in existing rpm versions, so people have been forced to look for "whatever works" alternatives.

What I will do anyway is make double-quotation work for the special %doc (and %license) directives, to make the %files list behavior consistent.

What to do with the rest is a bigger question mark: while its possible to revert back to mostly "traditional" behavior for %doc, that would open up the possibilities for nasty hacks (like passing arguments to "cp") again. I'd rather not go there. Another possibility would be allowing single-quotation and backslash-escaping everywhere in %files, but that has a bigger chance of breaking something else in turn and not something I'd want to do right before a stable release.

I'm tempted to just fix the double-quotation and tell people to use globs (the other "official" method) to workaround spaces in filenames for %doc if compatibility across different versions of rpm is needed, but maybe I'd better sleep on it a bit.

01/21/13 15:33:56 changed by pmatilai

  • status changed from new to assigned.

01/21/13 18:10:24 changed by opoplawski

I'm happy with just about anything that would work. For me using ? instead of "\ " does the trick.

01/29/13 09:31:01 changed by pmatilai

  • status changed from assigned to closed.
  • resolution set to fixed.
  • milestone set to rpm-4.11.0.

Okay, considering this fixed then: rpm >= 4.11 only accepts double-quoting and globbing for %doc (and %license), and rpm >= 4.10.3 adds support for double-quoting (while remaining compatible with the old hacks). Interoperability with older versions can be achieved with globs.