Bug 928110

Summary: Escaped spaces not handled in %doc
Product: [Fedora] Fedora Reporter: Nicolas Chauvet (kwizart) <kwizart>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: ffesti, jzeleny, novyjindrich, packaging-team-maint, pknirsch, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-11 23:36:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nicolas Chauvet (kwizart) 2013-03-26 23:03:53 UTC
Description of problem:
Files with escaped spaces in %doc aren't properly handled.

Version-Release number of selected component (if applicable):
4.11.0.1-2.fc19

How reproducible:
always

Steps to Reproduce:
1. Rebuild http://download1.rpmfusion.org/free/fedora/development/19/source/SRPMS/faad2-2.7-2.fc17.src.rpm

  
Actual results:
build failed with:
cp: missing destination file operand after 'docs/Ahead /builddir/build/BUILDROOT/faad2-2.7-3.fc20.x86_64/usr/share/doc/faad2-devel-2.7'
Try 'cp --help' for more information.
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.EFcwXi (%doc)
    Bad exit status from /var/tmp/rpm-tmp.EFcwXi (%doc)
Child return code was: 1

Expected results:
It has succeeded with earlier rpm release.

Additional info:
quote of the %doc section in the faad2.spec file:
-------------------
%files devel
%defattr(-, root, root, -)
%doc TODO docs/Ahead\ AAC\ Decoder\ library\ documentation.pdf
...
-------------------

Comment 1 Panu Matilainen 2013-03-27 05:28:52 UTC
There's a bug but it's not quite what you think: backslash-escaping has never been supported in %files section, but it has accidentally worked in %doc due to how older versions pass it to shell and cp. Rpm >= 4.11 processes %doc in more controlled manner, meaning most of the wild hacks people have used in there no longer work. What makes it all so ugly is that double-quoting which the rest of the %files section supports did not work for %doc in the older rpm versions so people we kinda forced to be creative there.

Rpm >= 4.10.3 supports double-quoting for %doc, but rpm 4.9.x in Fedora 17 doesn't. That could be backported, its a pretty trivial fix. However for now, the compatible way that works everywhere (including EPEL and all) is using globs, eg:

%doc TODO docs/Ahead?AAC?Decoder?library?documentation.pdf

Comment 2 Fedora Update System 2013-03-27 06:39:05 UTC
rpm-4.9.1.3-8.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/rpm-4.9.1.3-8.fc17

Comment 3 Fedora Update System 2013-03-27 20:32:19 UTC
Package rpm-4.9.1.3-8.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing rpm-4.9.1.3-8.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-4488/rpm-4.9.1.3-8.fc17
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-04-11 23:36:26 UTC
rpm-4.9.1.3-8.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.