From 54a4cd434b6478853885e4ef551a66ba2dc8ffea Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Wed, 28 Sep 2011 16:48:21 +0200 Subject: [PATCH] Update kernel space check. --- src/functions.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/functions.sh b/src/functions.sh index be41f84..776c5dd 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -1254,11 +1254,15 @@ check_archives_space() { } check_kernel_space() { - local available_disk_space kernel_size linux_images pkg ret + local available_disk_space kernel_size linux_images metapkg pkg ret available_disk_space=$(free_space /) linux_images=$(apt-cache show kernel-2.6-cn | grep ^Depends: \ - | grep -o 'linux-image[^ ]*') - for pkg in $linux_images; do + | grep -o 'linux-image[^, ]*') + for metapkg in $linux_images; do + pkg=$(apt-cache show $metapkg | grep ^Depends: \ + | grep -o 'linux-image[^, ]*' | head -1) + [ "$pkg" ] || continue + kernel_size=$(installed_size $pkg) ret=$? [ $ret -eq 0 ] && break -- 1.7.10.4