CVS java-package/lib

Jeroen van Wolffelaar jeroen@haydn.debian.org
Tue Feb 8 07:14:04 2005


Update of /cvsroot/pkg-java/java-package/lib
In directory haydn:/tmp/cvs-serv11504/lib

Modified Files:
	common.sh 
Log Message:
* Drop the df output parsing, use '/usr/bin/stat' instead (Closes: #293487,
  #289006, #293350)


--- /cvsroot/pkg-java/java-package/lib/common.sh	2005/01/26 15:47:05	1.6
+++ /cvsroot/pkg-java/java-package/lib/common.sh	2005/02/08 14:13:52	1.7
@@ -27,13 +27,8 @@
 function diskfree() {
     local size="$1"
     echo -n "Checking free diskspace:"
-    read dummy dummy free2 free dummy < <( df --block-size=1M "$tmp" | tail -n 1 )
+	(( free = `stat -f -c '%a / 2048 * ( %s / 512 )' $tmp ` ))
 
-	# With long device names (devfsd) the number we're interested in might be
-	# shifted one entry to the left (#289006)
-	if [ "$free" != "${free%\%}" ]; then
-		free="$free2"
-	fi
     if [ "$free" -ge "$size" ]; then
 	echo " done."
     else