View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012542CMakeCPackpublic2011-10-27 09:322011-10-27 11:41
ReporterAlex Neundorf 
Assigned ToEric NOULARD 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionCMake 2.8.6 
Target VersionFixed in Version 
Summary0012542: Uninstalling a cpack-generated rpm leaves empty directories behind
DescriptionWe are using cpack to generate rpms for our package.
When such a rpm is uninstalled later on, the files are removed, but empty directories are left behind.
It would be nice if those would be removed too.

One way could be to collect all installed directories, and put them with %dir in the spec file.
But, AFAIK, not all those directories should be removed when uninstalling the package, e.g. /usr/local/bin should not be removed.
One way to do this would be to filter the obtained list of directories against a set of known directories (e.g. from CMAKE_PREFIX_PATH), so that /usr, /usr/local, and their bin, include and lib directories are filtered out.
This could be extended by an additional variable e.g. in Modules/Platforms/UnixPaths.cmake like CMAKE_OTHER_STANDARD_PATHS which could contain e.g. shared/, doc/ etc.

Alex

TagsNo tags attached.
Attached Files

 Relationships
related to 0009654closedEric NOULARD [CPackRPM] %files section in spec file shall not contain all directories 
related to 0012305closedEric NOULARD RPM should include directories 

  Notes
(0027660)
Eric NOULARD (developer)
2011-10-27 09:52

Hi Alex,

This include or not include dir is somehow popping-up again
in various direction each time...
See 0012305

May be you have ready-to-run test case for that?
(0027661)
Eric NOULARD (developer)
2011-10-27 09:56

Alex,

Reading the referred bug makes me think that rpm command should remove
a directory when no installed packaged are refering to the dir.

Reading your report makes me think the other way around...

Thus my previous comment: do you have a simple test case at hand?

Could give me more info on the distro you use (Fedora, CentOS, OpenSuSE ???)
and what is the rpm version installed on the distro.

$ rpmbuild --version

should give you the answer.
(0027662)
Alex Neundorf (developer)
2011-10-27 10:39

Tested on OpenSUSE 11.4 (rpm 4.8.0), SLES 10 (rpm 4.4.2), Scientific Linux 6 (rpm 4.8.0) and Centos 5.6 (rpm 4.4.2.3), the empty directories stay on all 4 systems.

I just saw in your other bug report that there may be a change with cmake 2.8.6, this was still with 2.8.4.
...testing now with 2.8.6.

Alex
(0027663)
Alex Neundorf (developer)
2011-10-27 11:41

Ok, works fine with cmake 2.8.6.
Tested on OpenSUSE 11.4 and Centos 5.6.
Empty directories are removed.

 Issue History
Date Modified Username Field Change
2011-10-27 09:32 Alex Neundorf New Issue
2011-10-27 09:32 Alex Neundorf Status new => assigned
2011-10-27 09:32 Alex Neundorf Assigned To => Eric NOULARD
2011-10-27 09:33 Alex Neundorf Relationship added related to 0009654
2011-10-27 09:52 Eric NOULARD Note Added: 0027660
2011-10-27 09:52 Eric NOULARD Relationship added related to 0012305
2011-10-27 09:56 Eric NOULARD Note Added: 0027661
2011-10-27 10:39 Alex Neundorf Note Added: 0027662
2011-10-27 11:41 Alex Neundorf Note Added: 0027663
2011-10-27 11:41 Alex Neundorf Status assigned => closed
2011-10-27 11:41 Alex Neundorf Resolution open => no change required


Copyright © 2000 - 2018 MantisBT Team