mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-15 17:23:10 +09:00
Feature #1770: Handle non-uniform 'file -b' output in distributions
(cherry picked from commit c1ff1fd11b)
This commit is contained in:
1 parent
c1d3f62543
commit
d6438fb623
1 file changed
+2
-2
@@ -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')
|
||||
;;
|
||||
*)
|
||||
|
||||
Reference in new issue
Block a user