Bug 728959 - Unpackaged files check does not check %{buildroot}%{_docdir}/%{name}-%{version}
Summary: Unpackaged files check does not check %{buildroot}%{_docdir}/%{name}-%{version}
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 20
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
Assignee: Fedora Packaging Toolset Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1078760 1105790 1116373 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-08 13:36 UTC by Paul Howarth
Modified: 2015-04-24 09:28 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-17 12:47:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Sample spec file demonstrating the problem (464 bytes, text/plain)
2011-08-08 13:37 UTC, Paul Howarth
no flags Details

Description Paul Howarth 2011-08-08 13:36:17 UTC
Description of problem:
Prior to rpm 4.9.1, if there was a %doc entry in the %files list with a relative pathname, rpm would clear %{buildroot}%{_docdir}/%{name}-%{version} and then copy in the requested files. With rpm 4.9.1, this clearing does not happen and so any files already installed there during %install and not overwritten are still there in the built package. Moreover, the unpackaged files check does not detect them. This may result in unexpected files being included in built packages, and possibly additional dependencies as a result.

Version-Release number of selected component (if applicable):
rpm-4.9.1.1-1.fc17

How reproducible:
Every time.

Steps to Reproduce:
1. Build a package using the attached spec
2. rpm -qlp bugdemo-1.0-1.noarch.rpm
  
Actual results:
/usr/share/doc/bugdemo-1.0
/usr/share/doc/bugdemo-1.0/packaged
/usr/share/doc/bugdemo-1.0/unpackaged

Expected results:
/usr/share/doc/bugdemo-1.0
/usr/share/doc/bugdemo-1.0/packaged

Comment 1 Paul Howarth 2011-08-08 13:37:08 UTC
Created attachment 517217 [details]
Sample spec file demonstrating the problem

Comment 2 Fedora Admin XMLRPC Client 2012-04-13 23:07:02 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Fedora Admin XMLRPC Client 2012-04-13 23:10:37 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora End Of Life 2013-04-03 16:46:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 5 Panu Matilainen 2014-03-25 10:28:43 UTC
*** Bug 1078760 has been marked as a duplicate of this bug. ***

Comment 6 Miroslav Suchý 2014-03-26 08:00:11 UTC
Note that it have consequences for -doc subpackages as stated in bug 1078760. Therefore raising priority.

Confirmed on F20.

Comment 7 Panu Matilainen 2014-03-26 08:36:35 UTC
Sure it has consequences, and apparently also made worse by the unversioned doc directory change.

Problem is, the only "easy" thing to do is to revert back to the old behavior where the docdir is forced clean if %doc is used. And at this point there's likely more than a few packages depending in the new behavior.

Comment 8 Miroslav Suchý 2014-06-09 08:37:51 UTC
*** Bug 1105790 has been marked as a duplicate of this bug. ***

Comment 9 Miroslav Suchý 2014-09-05 09:35:25 UTC
Can you please give this little bit priority? This bug cause that lots of rpm packages have docfiles included and make resulting Fedora distribution bigger. Also this cause some confusions during Package Reviews.

Comment 10 Ľuboš Kardoš 2015-04-17 12:47:20 UTC
Fixed upstream f16a522ca4be7090db5a3fc1a507e58a4d4946fd. Docdir is not cleaned but only files that are explicitly listed in spec are included in package. If docdir contain file not listed in spec file, then rpm complains about it as it does with any other not listed file.

Comment 11 Ľuboš Kardoš 2015-04-17 12:48:19 UTC
*** Bug 1116373 has been marked as a duplicate of this bug. ***

Comment 12 Panu Matilainen 2015-04-20 10:07:36 UTC
Ľuboš, that change breaks common %doc usages, for a reproducer try rebuilding the Fedora rpm package for example.

Comment 13 Ľuboš Kardoš 2015-04-20 13:29:10 UTC
(In reply to Panu Matilainen from comment #12)
> Ľuboš, that change breaks common %doc usages, for a reproducer try
> rebuilding the Fedora rpm package for example.

Fixed in commit a817b246330780902eaed12633ce9282ef715fd9

Comment 14 Panu Matilainen 2015-04-21 11:19:09 UTC
Looks better, but I think there's still something fishy as "%doc foo/" (where foo is an actual directory) causes "File listed twice" warnings which were not there before these changes. Point really being, make sure you're handling all the crazy cases it supports due to being handled by "cp -r" underneath :)

Comment 15 Ľuboš Kardoš 2015-04-24 09:28:10 UTC
(In reply to Panu Matilainen from comment #14)
> Looks better, but I think there's still something fishy as "%doc foo/"
> (where foo is an actual directory) causes "File listed twice" warnings which
> were not there before these changes. Point really being, make sure you're
> handling all the crazy cases it supports due to being handled by "cp -r"
> underneath :)

Next try in commit b52a5ca55722b0b5316cf8189b6caa285ba5c469


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