linamh/sys-boot/elilo/files/elilo.sh-chkspace.patch

16 lines
833 B
Diff
Raw Normal View History

Don't count duplicate files twice when summing bytesneeded
--- elilo/debian/elilo.sh.chkspace 2006-03-16 07:53:00.000000000 -0500
+++ elilo/debian/elilo.sh 2006-03-16 07:53:27.000000000 -0500
@@ -580,7 +580,9 @@
sed 's/.*=[[:space:]]*//' | grep -v ':'`
vmmfiles=`grep '^[[:space:]]*vmm[[:space:]]*=' $bootconf | \
sed 's/.*=[[:space:]]*//' | grep -v ':'`
- bytesneeded=`cat $imagefiles $initrdfiles $vmmfiles 2>/dev/null | wc -c`
+ allfiles=`for f in $imagefiles $initrdfiles $install $bootconf; do \
+ echo $f; done | sort -u`
+ bytesneeded=`cat $allfiles 2>/dev/null | wc -c`
# convert to KB, allowing 5% overhead
kbneeded=$(( bytesneeded / 1024 + bytesneeded / 20480 ))
kbavailable=$(df -P -k $TARGET | sed -n "s|^$boot[[:space:]]\+[0-9]\+[[:space:]]\+[0-9]\+[[:space:]]\+\([0-9]\+\).*$|\1|p")