MantisBT - CMake
View Issue Details
0012863CMakeCPackpublic2012-01-08 22:272012-07-09 06:52
Deborah Pickett 
CMake 2.8.7 
CMake 2.8.8CMake 2.8.8 
0012863: CPackRPM reports "warning: File listed twice" because it recurses directories in %files
During RPM packing, the %files list in the .spec file contains all directory ancestors of installed files (i.e., it includes /usr and /usr/bin as well as /usr/bin/foo). Because unadorned entries in %files that are directories will be recursively searched, this causes /usr to bring in /usr/bin and /usr/bin/foo again, and /usr/bin to bring in /usr/bin/foo again-again. rpmbuld reports this with "warning: File listed twice: /usr/bin/foo".
Pack any RPM that installs to a directory at least two levels under / (e.g., /usr/bin/foo). Pack with debugging on: cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
%dir directive for RPM spec: [^]
No tags attached.
related to 0012305closed Eric NOULARD RPM should include directories 
related to 0012864closed Eric NOULARD CPackRPM additional variable CPACK_RPM_FILTER_FILELIST to remove well-known directories from %files list 
patch cmake-0012863.patch (1,202) 2012-01-12 23:17
Issue History
2012-01-08 22:27Deborah PickettNew Issue
2012-01-08 22:29Deborah PickettNote Added: 0028215
2012-01-09 02:09Eric NOULARDAssigned To => Eric NOULARD
2012-01-09 02:09Eric NOULARDStatusnew => assigned
2012-01-09 02:09Eric NOULARDRelationship addedrelated to 0012305
2012-01-12 21:53Davorin UčakarNote Added: 0028283
2012-01-12 22:04Deborah PickettNote Added: 0028284
2012-01-12 23:17Deborah PickettFile Added: cmake-0012863.patch
2012-01-12 23:19Deborah PickettNote Added: 0028285
2012-01-12 23:20Deborah PickettNote Edited: 0028285bug_revision_view_page.php?bugnote_id=28285#r495
2012-01-13 14:50Eric NOULARDRelationship addedrelated to 0012864
2012-01-13 14:54Eric NOULARDNote Added: 0028296
2012-01-13 15:40Eric NOULARDTarget Version => CMake 2.8.8
2012-01-13 15:41Eric NOULARDNote Added: 0028297
2012-01-13 15:41Eric NOULARDStatusassigned => resolved
2012-01-13 15:41Eric NOULARDFixed in Version => CMake 2.8.8
2012-01-13 15:41Eric NOULARDResolutionopen => fixed
2012-07-09 06:52David ColeNote Added: 0029955
2012-07-09 06:52David ColeStatusresolved => closed

Deborah Pickett   
2012-01-08 22:29   
Suggested fix: When CPackRPM.cmake produces the list of files in %files, it should mark any that are directories with %dir. Since CPack already does the recursive traversal of directories' descendants, it should prevent rpmbuild from doing it again.
Davorin Učakar   
2012-01-12 21:53   
I see this issue occurs because 0012305 hasn't been fixed properly. I suggested to revert to the state before 0009654 was "fixed" i.e. %files section should look like:

Deborah Pickett   
2012-01-12 22:04   
Disagree with 0028283: it would make 0012864 impossible to implement.
Deborah Pickett   
2012-01-12 23:19   
(edited on: 2012-01-12 23:20)
Attached patch 2012-01-12 23:17 (against 2.8.7) prepends %dir onto directories per comment 0028215.

2012-01-13 14:54   
Hi all,

To Davorin:
Deborah is right for 0012305 and 0012542 needs the feature too.
Initially (before 0012542) the file section was like you said: "/*"
unfortunately this scheme is "too simple" to fits the needs.

To Deborah:
Thanks for the patch I'll review it.
2012-01-13 15:41   
Thank you Deborah,

Patch was clean, just added some more comment giving some explanation
about why we do that.

Just merged to next.
Fetching upstream next
Merge topic 'CPackRPM-noFileListedTwice' into next

ae250d5 CPackRPM flag direcories with %dir in the generated spec file

should be in 2.8.8
David Cole   
2012-07-09 06:52   
Closing resolved issues that have not been updated in more than 4 months.