diff options
author | Chris Johns <chrisj@rtems.org> | 2013-09-03 07:59:38 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2013-09-03 07:59:38 +1000 |
commit | 348e4983dff47b1a7a8ab6d442966a2846263411 (patch) | |
tree | 55307ff5aed87997aceb22f5b2d5abe6cd9d0ebf /source-builder/sb/options.py | |
parent | sb: Add NetBSD support. (diff) | |
download | rtems-source-builder-348e4983dff47b1a7a8ab6d442966a2846263411.tar.bz2 |
sb: Add options log_info.
Provide a log_info method for the options class to log the command line
and the python version string.
Diffstat (limited to 'source-builder/sb/options.py')
-rw-r--r-- | source-builder/sb/options.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source-builder/sb/options.py b/source-builder/sb/options.py index 1a9c6d0..9be98c1 100644 --- a/source-builder/sb/options.py +++ b/source-builder/sb/options.py @@ -35,6 +35,8 @@ import macros import path import sys +import version + basepath = 'sb' # @@ -460,6 +462,10 @@ class command_line: def download_disabled(self): return self.opts['no-download'] != '0' + def log_info(self): + log.output(' Command Line: %s' % (' '.join(self.argv))) + log.output(' Python: %s' % (sys.version.replace('\n', ''))) + def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'): """ Copy the defaults, get the host specific values and merge them overriding @@ -526,17 +532,17 @@ def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'): o.process() o.post_process() - log.notice(' '.join(args)) - return o def run(args): try: _opts = load(args = args, defaults = 'defaults.mc') - print 'Options:' - print _opts - print 'Defaults:' - print _opts.defaults + log.notice('RTEMS Source Builder - Defaults, v%s' % (version.str())) + _opts.log_info() + log.notice('Options:') + log.notice(str(_opts)) + log.notice('Defaults:') + log.notice(str(_opts.defaults)) except error.general, gerr: print gerr sys.exit(1) |