From e5ef23145f0dc6523a5c5321a21407c955777ad2 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 10 Dec 2014 10:16:02 -0500 Subject: [PATCH] tighten filtering of kernel images in apt.auto-removal MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The current filtering matches the names of the image metapackages on the i386 architecture: $ dpkg-query -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]/ && $2 !~ /-dbg$/ { print $2 }' linux-image-3.16.0-4-586 linux-image-586 This results in an extra image package being removed from APT::NeverAutoRemove, losing the intended effect of keeping the {current, previous, latest} set of images installed. Requiring a “.” in the package name tightens the matched package names to those that are installing a specific version of the image, thus eliding the meta-packages. Closes: 772732 --- debian/apt.auto-removal.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/apt.auto-removal.sh b/debian/apt.auto-removal.sh index c0041612..807c6f74 100644 --- a/debian/apt.auto-removal.sh +++ b/debian/apt.auto-removal.sh @@ -41,7 +41,7 @@ version_test_gt () return "$?" } -list="$(${DPKG} -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]/ && $2 !~ /-dbg$/ { print $2 }' | sed -e 's#\(linux\|kfreebsd\|gnumach\)-image-##')" +list="$(${DPKG} -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]+\./ && $2 !~ /-dbg$/ { print $2 }' | sed -e 's#\(linux\|kfreebsd\|gnumach\)-image-##')" latest_version="" previous_version="" -- 2.20.1