From 4c0c59b1e34d05de3b224a3d18d3a77dd6fc2dda Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 6 Jul 2015 01:03:50 +0200 Subject: reproducible coreboot/openwrt/netbsd: display sensible file sizes --- bin/reproducible_common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bin/reproducible_common.sh') diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 4b6fc2f0..777cd63f 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -411,3 +411,14 @@ call_debbindiff_on_any_file() { echo $msg | tee -a $TMPDIR/$1/$2.html fi } + +get_filesize() { + local BYTESIZE="$(du -h -b $1 | cut -f1)" + if [ $BYTESIZE -gt 1048576 ] ; then + SIZE="$(echo $BYTESIZE/1048576|bc)M" + elif [ $BYTESIZE -gt 1024 ] ; then + SIZE="$(echo $BYTESIZE/1024|bc)K" + else + SIZE="$(echo $BYTESIZE/1024|bc) bytes" + fi +} -- cgit v1.2.3-70-g09d2