[rtems-source-builder commit] sb: Add build sizes to the email report.

Chris Johns chrisj at rtems.org
Thu Sep 27 22:18:46 UTC 2018


Module:    rtems-source-builder
Branch:    master
Commit:    079f95a91b2193a5e23bbd0338d41a2137b1dd9b
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=079f95a91b2193a5e23bbd0338d41a2137b1dd9b

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Sep 28 08:15:55 2018 +1000

sb: Add build sizes to the email report.

- Include build sizes in the email report.

Updates #3516

---

 source-builder/sb/setbuilder.py | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index 2e6d643..c50ba20 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -467,11 +467,16 @@ class buildset:
                 for p in builds[0].config.expand('%{_patchdir}').split(':'):
                     size_patches += path.get_size(p)
                 size_total = size_sources + size_patches + size_installed
-                build_size = 'usage: %s' % (build.humanize_number(size_build_max + size_installed, 'B'))
-                build_size += ' total: %s' % (build.humanize_number(size_total, 'B'))
-                build_size += ' (sources: %s' % (build.humanize_number(size_sources, 'B'))
-                build_size += ', patches: %s' % (build.humanize_number(size_patches, 'B'))
-                build_size += ', installed %s)' % (build.humanize_number(size_installed, 'B'))
+                build_max_size_human = build.humanize_number(size_build_max + size_installed, 'B')
+                build_total_size_human = build.humanize_number(size_total, 'B')
+                build_sources_size_human = build.humanize_number(size_sources, 'B')
+                build_patches_size_human = build.humanize_number(size_patches, 'B')
+                build_installed_size_human = build.humanize_number(size_installed, 'B')
+                build_size = 'usage: %s' % (build_max_size_human)
+                build_size += ' total: %s' % (build_total_size_human)
+                build_size += ' (sources: %s' % (build_sources_size_human)
+                build_size += ', patches: %s' % (build_patches_size_human)
+                build_size += ', installed %s)' % (build_installed_size_human)
             #
             # Cleaning ...
             #
@@ -521,7 +526,15 @@ class buildset:
                 body = self.get_mail_header()
                 body += 'Sizes' + os.linesep
                 body += '=====' + os.linesep + os.linesep
-
+                if len(builds) > 1:
+                    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
+                    body += 'Sources: ' + build_sources_size_human + os.linesep
+                    body += 'Sources: ' + build_patches_size_human + os.linesep
+                else:
+                    body += 'No packages built'
+                body += os.linesep
                 body += 'Output' + os.linesep
                 body += '======' + os.linesep + os.linesep
                 body += os.linesep.join(mail['output'].get())




More information about the vc mailing list