Bug 1108071 - rpm doesn't accept %doc with escaped whitespaces
Summary: rpm doesn't accept %doc with escaped whitespaces
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-11 12:14 UTC by Ralf Corsepius
Modified: 2014-06-11 14:02 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-11 13:18:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ralf Corsepius 2014-06-11 12:14:57 UTC
Description of problem:
Fedora's rpmbuild doesn't handle %doc file containing escaped white spaces

e.g. case like these:
%files
%doc Devel\ Docs/COPYING

Version-Release number of selected component (if applicable):
rpm-4.11.2-2.fc19.x86_64
rpm-4.11.2-2.fc20.x86_64
rpm-4.11.2-11.fc21.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Write a spec, which contains a %doc directive pointing to a file with whitespaces on its path.
2. Try to build the rpm


Actual results:
rpmbuild chokes due to broken handling of such files.

Expected results:
- Function


Additional info:
- Such constructs work on CentOS6.
- This behavioral change is the cause some Fedora FTBFSs:
Real world case: https://bugzilla.redhat.com/show_bug.cgi?id=1106055

Comment 1 Panu Matilainen 2014-06-11 13:18:31 UTC
This is an intentional change, in rpm >= 4.11 %doc (and %license) files follow the same rules as the rest of %files. See http://rpm.org/ticket/858 for details but in short, there are two options:

1) Use double-quotation
2) Use globs to cover the whitespace. This is also backwards compatible to older versions.

Comment 2 Ralf Corsepius 2014-06-11 13:24:38 UTC
(In reply to Panu Matilainen from comment #1)
> This is an intentional change,
To me, this is simply a regression - period.

> in rpm >= 4.11 %doc (and %license) files
> follow the same rules as the rest of %files. See http://rpm.org/ticket/858
> for details but in short, there are two options:
> 
> 1) Use double-quotation
You mean full double-quotes: %doc "foo bar/baz"

Partial double-quotes: %doc "foo bar"/baz
do not work.

Unfortunately, neither of these work on RHEL.

> 2) Use globs to cover the whitespace. This is also backwards compatible to
> older versions.
With all due respect, but you don't want to hear what I thin about this proposal.

Comment 3 Panu Matilainen 2014-06-11 14:02:51 UTC
Please understand that backslash escaping in %doc only ever worked accidentally, it never was an intended or documented feature but just a hack people came up with because it seemed to work where everything else failed - older versions did not support double quoting either. Just like "%doc --parents foo/" used to "work" because the whole line was simply passed as-is to the "cp" command.

A third option would be adding *proper* support for backslash-escaping *everywhere* in %files. I dont think anybody would object to that ... patches welcome.


Note You need to log in before you can comment on or make changes to this bug.