From ee76f711fdc35daef8c488ea863d9d6c9de36a1e Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 19 Oct 2011 23:04:15 +0200 Subject: [PATCH] bug #867: Minor change to du function --- src/image_mad/remotes/fs/fsrc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/image_mad/remotes/fs/fsrc b/src/image_mad/remotes/fs/fsrc index 0f49049d1f..c2f2e8c519 100644 --- a/src/image_mad/remotes/fs/fsrc +++ b/src/image_mad/remotes/fs/fsrc @@ -41,19 +41,15 @@ echo "$IMAGE_REPOSITORY_PATH/`echo $CANONICAL_MD5 | cut -d ' ' -f1`" } function fs_du { - SIZE="" - QEMU_IMG=`command -v qemu-img` - if [ "$?" = "0" ]; then + if [ $? = 0 ]; then SIZE=$($QEMU_IMG info $1|awk '/^virtual size:/{print substr($4,2)}') - fi - - if [ -z "$SIZE" ]; then + else SIZE=$(stat -c %s $1) fi SIZE=$(($SIZE/1048576)) echo "$SIZE" -} +} \ No newline at end of file