summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_common.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-07-06 01:03:50 +0200
committerHolger Levsen <holger@layer-acht.org>2015-07-06 01:03:50 +0200
commit4c0c59b1e34d05de3b224a3d18d3a77dd6fc2dda (patch)
treef6a484b9c124103073faf3f2a01ea79e355b9158 /bin/reproducible_common.sh
parent2aec09b9768ce2723747837f4ca59d97bf5af7ec (diff)
downloadjenkins.debian.net-4c0c59b1e34d05de3b224a3d18d3a77dd6fc2dda.tar.xz
reproducible coreboot/openwrt/netbsd: display sensible file sizes
Diffstat (limited to 'bin/reproducible_common.sh')
-rwxr-xr-xbin/reproducible_common.sh11
1 files changed, 11 insertions, 0 deletions
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
+}