Package: upgrade-system
Version: 1.7.1.1
Severity: important

Whenever packages skip their DPKG triggers, it leaves their DPKG status as 
half-configured, which makes 'deborphan' exit with an error.

This, in turn, breaks upgrade-system's loop for purging no longer needed 
packages. 

The attached patch adds an exit code to the loop and a warning to the 
administrator to execute 'dpkg --configure --pending' as root, to make DPKG run 
through all pending triggers.

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.16.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages upgrade-system depends on:
ii  apt        1.0.9.4
ii  deborphan  1.7.28.8-0.1

Versions of packages upgrade-system recommends:
ii  debsums  2.0.52+nmu2

upgrade-system suggests no packages.

-- Configuration Files:
/etc/upgrade-system.conf changed [not included]

-- no debconf information
diff -Nru upgrade-system-1.7.1.1/debian/changelog upgrade-system-1.7.2.1/debian/changelog
--- upgrade-system-1.7.1.1/debian/changelog	2014-09-25 07:42:30.000000000 +0300
+++ upgrade-system-1.7.2.1/debian/changelog	2014-12-06 14:34:14.000000000 +0200
@@ -1,3 +1,13 @@
+upgrade-system (1.7.2.1) unstable; urgency=medium
+
+  * upgrade-system:
+    + Added exit code to the orphan purging loop. This has become necessary
+      because some packages skip their DPKG triggers, which then makes DPKG
+      mark those packages as partially configured, in turn making deborphan
+      exit with an error.
+
+ -- Martin-Éric Racine <martin-eric.rac...@iki.fi>  Sat, 06 Dec 2014 14:33:38 +0200
+
 upgrade-system (1.7.1.1) unstable; urgency=medium
 
   * debian/control:
diff -Nru upgrade-system-1.7.1.1/upgrade-system upgrade-system-1.7.2.1/upgrade-system
--- upgrade-system-1.7.1.1/upgrade-system	2014-09-25 07:41:59.000000000 +0300
+++ upgrade-system-1.7.2.1/upgrade-system	2014-12-02 01:06:49.000000000 +0200
@@ -141,6 +141,11 @@
 do
 	DEBORPHANS_OLD=$DEBORPHANS
 	DEBORPHANS=$(deborphan $ORPHANOPTS)
+	if [ $? != 0 ]
+	then
+		echo "${RED}E: Checking failed unexpectedly. Run 'dpkg --configure --pending' as root.${RESET}"
+		exit 3
+	fi
 	##DEPENDS: deborphan (universe/optional).
 	ORPHANS=${REMOVABLE:+$REMOVABLE }$DEBORPHANS
 	REMOVABLE=""
@@ -217,7 +222,7 @@
 				if [ $? != 0 ]
 				then
 					echo "${RED}E: Some dependencies could not be installed.${RESET}"
-					exit 3
+					exit 4
 				fi
 				;;
 		esac

Reply via email to