From 2b8357dc3dbae0bd8c523d9482566c0e5616ca21 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sat, 10 Jan 2015 21:09:49 +0100 Subject: reproducible: html_packages: output a error if the file size is larger than 1 GB + drop bigger units --- bin/reproducible_html_packages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bin') 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') -- cgit v1.2.3-70-g09d2