Changeset 4dc9bf3 in rtems-source-builder


Ignore:
Timestamp:
Oct 31, 2017, 12:57:21 AM (19 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
0f2cf80
Parents:
4e7fdaf
Message:

sb: Add platform reporting for better host reviewing in posted email reports.

Location:
source-builder/sb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/reports.py

    r4e7fdaf r4dc9bf3  
    6464        p = path.join(p, arg)
    6565    return os.path.abspath(path.host(p))
     66
     67def platform(mode = 'all'):
     68    import platform
     69    if mode == 'system':
     70        return platform.system()
     71    compact = platform.platform(aliased = True)
     72    if mode == 'compact':
     73        return compact
     74    extended = ' '.join(platform.uname())
     75    if mode == 'extended':
     76        return extended
     77    return '%s (%s)' % (short, extended)
    6678
    6779class formatter(object):
  • source-builder/sb/setbuilder.py

    r4e7fdaf r4dc9bf3  
    3131import os
    3232import sys
     33import textwrap
    3334
    3435try:
     
    342343        log.notice('Build Set: %s' % (self.bset))
    343344
    344         mail_subject = '%s on %s' % (self.bset, self.macros.expand('%{_host}'))
     345        mail_subject = '%s on %s' % (self.bset,
     346                                     self.macros.expand('%{_host}'))
    345347
    346348        current_path = os.environ['PATH']
     
    473475                self.write_mail_header('', True)
    474476                if self.build_failure is not None:
    475                     mail_subject = 'Build : FAILED %s (%s)' % \
     477                    mail_subject = 'FAILED %s (%s)' % \
    476478                        (mail_subject, self.build_failure)
    477479                else:
    478                     mail_subject = 'Build : PASSED %s' % (mail_subject)
     480                    mail_subject = 'PASSED %s' % (mail_subject)
     481                mail_subject = 'Build %s: %s' % (reports.platform(mode = 'system'),
     482                                                 mail_subject)
    479483                self.write_mail_header(mail['header'], True)
    480484                self.write_mail_header('')
     
    535539            raise error.general('host build environment is not set up correctly')
    536540        if mail:
    537             mail['header'] = os.linesep.join(mail['output'].get())
     541            mail['header'] = os.linesep.join(mail['output'].get()) + os.linesep
    538542            mail['header'] += os.linesep
    539             mail['header'] += opts.info() + os.linesep
     543            mail['header'] += 'Host: '  + reports.platform('compact') + os.linesep
     544            indent = '       '
     545            for l in textwrap.wrap(reports.platform('extended'),
     546                                   width = 80 - len(indent)):
     547                mail['header'] += indent + l + os.linesep
    540548        configs = build.get_configs(opts)
    541549        if opts.get_arg('--list-deps'):
Note: See TracChangeset for help on using the changeset viewer.