From: Valentin Vidic Date: Wed, 28 Sep 2011 14:48:21 +0000 (+0200) Subject: Update kernel space check. X-Git-Tag: debian/6.0.0~17 X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=commitdiff_plain;h=54a4cd434b6478853885e4ef551a66ba2dc8ffea;p=carnet-upgrade.git Update kernel space check. --- 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