[PATCH] Fix 'build_max_size_human' ref. before assignment

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jan 10 12:15:33 UTC 2019


Close #3568.
---
 source-builder/sb/setbuilder.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index dbc4035..c94ff8b 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -361,6 +361,7 @@ class buildset:
 
             log.trace('_bset: %s: configs: %s'  % (self.bset, ','.join(configs)))
 
+            sizes_valid = False
             builds = []
             for s in range(0, len(configs)):
                 b = None
@@ -478,6 +479,7 @@ class buildset:
                 build_size += ' (sources: %s' % (build_sources_size_human)
                 build_size += ', patches: %s' % (build_patches_size_human)
                 build_size += ', installed %s)' % (build_installed_size_human)
+                sizes_valid = True
             #
             # Cleaning ...
             #
@@ -527,7 +529,7 @@ class buildset:
                 body = self.get_mail_header()
                 body += 'Sizes' + os.linesep
                 body += '=====' + os.linesep + os.linesep
-                if len(builds) > 1:
+                if sizes_valid:
                     body += 'Maximum build usage: ' + build_max_size_human + os.linesep
                     body += 'Total size: ' + build_total_size_human + os.linesep
                     body += 'Installed : ' + build_installed_size_human + os.linesep
-- 
2.16.4



More information about the devel mailing list