Ok, so I have found the culprit. The php5-cli uses ucf and hence the /etc/php5/cli/php.ini is not marked as conffile and so, the hasdirectoryconffiles check fails.
The attached patch keeps the directory in the <pkg>.list (aka add it to the leftover) if the children directory is found on the leftover list. There could be a slight modification to keep /. in the list as well to be formally correct, but IMO it's not needed. Also I have found a small bug in the matching function hasdirectoryconffiles and I am inheriting it (since I don't think it's major)... If there is a conffile named: /etc/pkg/foobar/foo.conf and directory /etc/pkg/foo then the /etc/pkg/foo is matched and not removed. If you want this fixed, just ping me, it's easy to add something like "&& (....->name[namelen] == \0 or ...->name[namelen] == '/')", and I'll fix it at both places. O. On Wed, May 4, 2011 at 06:20, Jonathan Nieder <jrnie...@gmail.com> wrote: > Ondřej Surý wrote: > >> At the moment the only solution I see is what I have suggested - keep >> ownership of whole tree up-to-the root for directories holding >> conffiles and try to remove them at purge time... >> >> dpkg --remove php5-cli >> # ownership kept for /., /etc, /etc/php5, /etc/php5/cli > > Yes, makes sense. > >> On Tue, May 3, 2011 at 01:05, Jonathan Nieder <jrnie...@gmail.com> wrote: > >>> If anyone interested in working on this has any questions, please feel >>> free to let us know. >> >> I could work on that... > > That would be excellent! > -- Ondřej Surý <ond...@sury.org> http://blog.rfc1925.org/
0001-Keep-parent-directories-for-directories-in-leftover-.patch
Description: Binary data