Control: merge 741962 -1 Control: tags -1 + pending Control: found -1 0.9.16 Control: notfound -1 0.9.15.5 On Sat, Mar 22, 2014 at 10:34:17AM +0100, Cristian Ionescu-Idbohrn wrote: > /etc/kernel/postinst.d/apt-auto-removal is run when installing a new > linux-image package. A package list is generated at some point, and > version numbers extracted: […] Correct analyse and patch, thanks! I have commited yesterday a slightly different fix though which removes the star from the initial matcher to get to the same behaviour – which was also the behaviour before 0.9.16 as shell glob vs regex. Best regards David Kalnischkies
commit a17482f89b636a52aacc57776bfc8041cf4da508
Author: David Kalnischkies <david@kalnischkies.de>
Date: Fri Mar 21 11:47:56 2014 +0100
only consider versioned kernel packages in autoremove
Metapackages like "linux-image-amd64" are otherwise matched by our
extraction as well, which later on can't be successfully compared via
dpkg --compare-versions as the 'amd64' bit isn't a version number.
(Luckily none of our architectures starts with a digit.)
This was broken by me in 0.9.16 as I moved a shell-glob matcher to a
regex-based one which has slightly different semantics regarding '*'.
Closes: 741962
diff --git a/debian/apt.auto-removal.sh b/debian/apt.auto-removal.sh
index 0c51586..c004161 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=""
diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove
index 7713c08..c51caa7 100755
--- a/test/integration/test-kernel-helper-autoremove
+++ b/test/integration/test-kernel-helper-autoremove
@@ -20,6 +20,7 @@ CURRENTKERNEL="linux-image-$(uname -r)"
insertinstalledpackage "$CURRENTKERNEL" 'amd64' '1'
insertinstalledpackage 'linux-image-1.0.0-2-generic' 'amd64' '1.0.0-2'
insertinstalledpackage 'linux-image-100.0.0-1-generic' 'amd64' '100.0.0-1'
+insertinstalledpackage 'linux-image-amd64' 'amd64' '100.0.0-1'
# ensure that the '.' is really a dot and not a wildcard
insertinstalledpackage 'linux-headers-1000000-1-generic' 'amd64' '100.0.0-1'
Attachment:
signature.asc
Description: Digital signature