projects
/
carnet-upgrade.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2709dd5
)
Update kernel space check.
author
Valentin Vidic
<Valentin.Vidic@CARNet.hr>
Wed, 28 Sep 2011 14:48:21 +0000
(16:48 +0200)
committer
Valentin Vidic
<Valentin.Vidic@CARNet.hr>
Wed, 28 Sep 2011 14:48:21 +0000
(16:48 +0200)
src/functions.sh
patch
|
blob
|
history
diff --git
a/src/functions.sh
b/src/functions.sh
index
be41f84
..
776c5dd
100644
(file)
--- a/
src/functions.sh
+++ b/
src/functions.sh
@@
-1254,11
+1254,15
@@
check_archives_space() {
}
check_kernel_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: \
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
kernel_size=$(installed_size $pkg)
ret=$?
[ $ret -eq 0 ] && break