]> git.saurik.com Git - apt.git/blobdiff - debian/apt.auto-removal.sh
refactor key removal code to reuse it in next step
[apt.git] / debian / apt.auto-removal.sh
index ab8201898f58382ac68af628637b278ae3fdd7cc..c00416127a26e27f9e413dc24f895627937ecdab 100644 (file)
@@ -41,7 +41,7 @@ version_test_gt ()
        return "$?"
 }
 
        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=""
 
 latest_version=""
 previous_version=""
@@ -63,13 +63,10 @@ then
        previous_version=
 fi
 
        previous_version=
 fi
 
-kernels=$(sort -u <<EOF
-$latest_version
+kernels="$(echo "$latest_version
 $installed_version
 $running_version
 $installed_version
 $running_version
-$previous_version
-EOF
-)
+$previous_version" | sort -u | sed -e 's#\.#\\.#g' )"
 
 generateconfig() {
        cat <<EOF
 
 generateconfig() {
        cat <<EOF