CVS java-package/lib
Jeroen van Wolffelaar
jeroen@haydn.debian.org
Mon Jan 24 17:05:06 2005
Update of /cvsroot/pkg-java/java-package/lib
In directory haydn:/tmp/cvs-serv31457/lib
Modified Files:
common.sh
Log Message:
* Work around multiline df output caused by long device names
(Closes: #289006)
--- /cvsroot/pkg-java/java-package/lib/common.sh 2005/01/24 23:25:51 1.4
+++ /cvsroot/pkg-java/java-package/lib/common.sh 2005/01/25 00:04:02 1.5
@@ -27,8 +27,13 @@
function diskfree() {
local size="$1"
echo -n "Checking free diskspace:"
- read dummy dummy dummy free dummy < <( df --block-size=1M "$tmp" | tail -n 1 )
- free=${free%M}
+ read dummy dummy free2 free dummy < <( df --block-size=1M "$tmp" | tail -n 1 )
+
+ # With long device names (devfsd) the number we're interested in might be
+ # shifted one entry to the left (#289006)
+ if [ "$free" -ne "${free%\%}" ]; then
+ free="$free2"
+ fi
if [ "$free" -ge "$size" ]; then
echo " done."
else