From d6438fb623fc30d1900f2ab3a6318a558db9b579 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Mon, 25 Nov 2013 15:13:56 +0100 Subject: [PATCH] Feature #1770: Handle non-uniform 'file -b' output in distributions (cherry picked from commit c1ff1fd11b1992601c86c3eedfbb4c7c080a398d) --- src/datastore_mad/remotes/libfs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datastore_mad/remotes/libfs.sh b/src/datastore_mad/remotes/libfs.sh index 373774092e..a32294ef6a 100644 --- a/src/datastore_mad/remotes/libfs.sh +++ b/src/datastore_mad/remotes/libfs.sh @@ -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') ;; *)