summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-10 21:09:49 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-11 00:39:20 +0000
commit2b8357dc3dbae0bd8c523d9482566c0e5616ca21 (patch)
tree3dd9e5617e6d2d5ad0f19389afabbdf72db153a4
parentf1b2112464b6430ad05b0d465f48d7a3c58bc305 (diff)
downloadjenkins.debian.net-2b8357dc3dbae0bd8c523d9482566c0e5616ca21.tar.xz
reproducible: html_packages: output a error if the file size is larger than 1 GB + drop bigger units
-rwxr-xr-xbin/reproducible_html_packages.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index 75b786f5..097ba718 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -42,8 +42,11 @@ $links
def sizeof_fmt(num):
- for unit in ['B','KB','MB','GB','TB','PB','EB','ZB']:
+ for unit in ['B','KB','MB','GB']:
if abs(num) < 1024.0:
+ if unit == 'GB':
+ log.error('The size of this file is bigger than 1 GB!')
+ log.error('Please check')
return str(int(round(float("%3f" % num), 0))) + "%s" % (unit)
num /= 1024.0
return str(int(round(float("%f" % num), 0))) + "%s" % ('Yi')