Bug#984628: bsdmainutils: leaves alternatives after upgrade: /usr/bin/from

2021-03-23 Thread Andreas Beckmann
Followup-For: Bug #984628
Control: tag -1 patch

I've NMUed the alternatives cleanup with the attached patch.


Andreas
diff -Nru bsdmainutils-12.1.7+nmu2/debian/bsdmainutils.preinst 
bsdmainutils-12.1.7+nmu3/debian/bsdmainutils.preinst
--- bsdmainutils-12.1.7+nmu2/debian/bsdmainutils.preinst2020-07-20 
16:13:06.0 +0200
+++ bsdmainutils-12.1.7+nmu3/debian/bsdmainutils.preinst2021-03-23 
08:35:49.0 +0100
@@ -35,5 +35,9 @@
prepare_rm_conffile /etc/cron.daily/bsdmainutils bsdmainutils
 fi
 
+if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 12.1.7+nmu3~; then
+   update-alternatives --remove from /usr/bin/bsd-from
+fi
+
 #DEBHELPER#
 
diff -Nru bsdmainutils-12.1.7+nmu2/debian/changelog 
bsdmainutils-12.1.7+nmu3/debian/changelog
--- bsdmainutils-12.1.7+nmu2/debian/changelog   2021-02-15 11:31:35.0 
+0100
+++ bsdmainutils-12.1.7+nmu3/debian/changelog   2021-03-23 08:57:20.0 
+0100
@@ -1,3 +1,10 @@
+bsdmainutils (12.1.7+nmu3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Remove obsolete /usr/bin/from alternative on upgrades.  (Closes: #984628)
+
+ -- Andreas Beckmann   Tue, 23 Mar 2021 08:57:20 +0100
+
 bsdmainutils (12.1.7+nmu2) unstable; urgency=medium
 
   * Non-maintainer upload.


Bug#984628: bsdmainutils: leaves alternatives after upgrade: /usr/bin/from

2021-03-05 Thread Andreas Beckmann
Package: bsdmainutils
Version: 12.1.7+nmu2
Severity: important
User: debian...@lists.debian.org
Usertags: piuparts

Hi,

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:

https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#details-of-removal-and-or-configuration-purging

The leftover files are actually alternatives that were installed by the
package but have not been properly removed.

Filing this as important as having a piuparts clean archive is a release
goal since lenny.

>From the attached log (scroll to the bottom...):

0m28.1s INFO: Warning: Package purging left files on system:
  /etc/alternatives/from -> /usr/bin/bsd-fromnot owned
  /etc/alternatives/from.1.gz -> /usr/share/man/man1/bsd-from.1.gz   not 
owned
  /etc/calendar/ not owned
  /etc/cron.daily/bsdmainutils.dpkg-remove   not owned
  /usr/bin/from -> /etc/alternatives/fromnot owned
  /usr/share/man/man1/from.1.gz -> /etc/alternatives/from.1.gz   not owned


Since the /usr/bin/bsd-from binary has been dropped in bullseye,
the alternative set up by the package from buster needs to be
cleaned up during postinst configure:

update-alternatives --remove write /usr/bin/bsd-write


cheers,

Andreas


bsdmainutils_12.1.7+nmu2.log.gz
Description: application/gzip