Enhanced handling of directories on package removing

Bug #1477125 reported by Removed by request
6
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm using Ubuntu 15.10 dev with dpkg 1.17.25ubuntu1 and if I'm removing a package I'm noticing that dpkg does remove empty directories even if they weren't created by the related package. Here is an example:

Test-package creation: mkdir -p test/DEBIAN; mkdir -p test/tmp/test; touch test/tmp/test/test.txt; chmod 0755 test/DEBIAN; echo Architecture: "$(dpkg --print-architecture)"$'\n'Description: 0$'\n'Maintainer: 0$'\n'Package: test$'\n'Version: 0 > test/DEBIAN/control; dpkg-deb -b test test.deb

If the installation directory gets created before installing and then removing the package it gets deleted too for example with this command: mkdir /tmp/test; dpkg -i test.deb; dpkg -r test

Maybe dpkg can be enhanced to avoid this situation. Also if a directory would contain "garbage" files before removing the related package dpkg will print a warning that the directory can't be removed but this information isn't logged. Maybe both situations could be solved with a simple database that keeps track of these states.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.