Feature #1770: Handle non-uniform 'file -b' output in distributions

(cherry picked from commit c1ff1fd11b)
This commit is contained in:
Jaime Melis authored and Ruben S. Montero committed 2013-11-25 16:59:28 +01:00
1 parent c1d3f62543
commit d6438fb623
1 file changed
+2 -2
+2 -2
View File
@@ -178,12 +178,12 @@ function fs_size {
SIZE=`du -sb "$1" | cut -f1`
error=$?
else
TYPE=$(cat "$1" | head -n 1024 | file -b -)
TYPE=$(cat "$1" | head -n 1024 | file -b - | tr A-Z a-z)
case "$TYPE" in
*gzip*)
SIZE=$(gzip_file_size "$1")
;;
*QCOW*)
*qcow*)
SIZE=$($QEMU_IMG info "$1" | sed -n 's/.*(\([0-9]*\) bytes).*/\1/p')
;;
*)