mass bug filing against packages that don't remove alternatives
On 2012-02-23 21:59, Jakub Wilk wrote:
> * Andreas Beckmann <email@example.com>, 2012-02-23, 21:49:
>> I'm planning to file bugs against all packages that currently leave
>> alternatives on the system after they were removed. Forgetting to
>> remove alternatives usually leaves dangling symlinks on the system and
>> in most cases these are dangling symlinks in /usr/bin
> The problem with alternatives is that nobody knows how to handle them
> correctly: see bug #71621 (no, I didn't forget the leading digit).
OK, I'll include some hints and rationale how to remove the alternative
properly (based on Jonathans reply to above bug):
during a test with piuparts I noticed your package left unowned files
on the system after purge, which is a violation of policy 6.8:
The leftover files are actually alternatives that were installed by
the package but have not been properly removed.
While there is ongoing discussion how to remove alternatives correctly
(see http://bugs.debian.org/71621 for details) the following strategy
should work for regular cases:
* 'postinst configure' always installs the alternative
* 'prerm remove' removes the alternative
* 'postrm remove' and 'postrm disappear' remove the alternative
In all other cases a maintainer script is invoked (e.g. upgrade,
deconfigure) the alternatives are not modified to preserve user
Removing the alternative in 'prerm remove' avoids having a dangling
link once the actual file gets removed, but 'prerm remove' is not
called in all cases (e.g. deconfigured or disappearing packages) so
the postrm must remove the alternative again (update-alternatives
gracefully handles removal of non-existing alternatives).
Filing this as important as having a piuparts clean archive is a
release goal since lenny.
From the attached log (scroll to the bottom...):
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org