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