[Piuparts-devel] Policy 6.8 unclear wrt to directories?

Andreas Beckmann debian at abeckmann.de
Thu Jan 19 12:47:18 UTC 2012

Hi Holger,

as there are quite some packages failing due to dpkg not cleaning up
directories properly, I'm considering filing a bug with the policy as
this seems to be unclear how directories are to be handled. But I'd like
to get your opinion first.

6.8 does not mention 'directories' at all, so I consider them as covered
by 'files' in (2.)

If I were to design the removal scheme I'd insert the following steps:

2a/4a: Directory Removal. Shared directories owned by the package are
unregistered (= removed from file list) unless there are configfiles
remaining in them. The empty directories owned by the package are
removed (= rmdir && removed from file list). (At this point the file
list contains conffiles, the paths to these conffiles, nonempty (= rmdir
fails, but there are no files/directories known to dpkg left)
directories solely owned by the package and the paths to them.)
Failing to remove a directory because it's not empty in the filesystem
should not produce a warning.
(this should be performed together with "step 2: removal of files" and
again after "step 3: postrm remove" as some directories may now be empty)

6a: Directory removal. The directories remaining in the file list of the
package are unregistered (shared directories) and removed (only
directories where package was the last owner). Failing to remove a
directory because it is not empty generates a warning.

Failing to remove a directory because it no longer exists should never
produce a warning.

The corresponding dpkg bug: http://bugs.debian.org/316521


More information about the Piuparts-devel mailing list