summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/setbuilder.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2013-03-04 09:42:08 +1100
committerChris Johns <chrisj@rtems.org>2013-03-04 09:42:08 +1100
commit864e8ff9faa311e949d96430c64c9df221bb0d4b (patch)
tree1fd96df499cd9d4c3432e9350f003fb0bab58e86 /source-builder/sb/setbuilder.py
parentCatch any importing errors. (diff)
downloadrtems-source-builder-864e8ff9faa311e949d96430c64c9df221bb0d4b.tar.bz2
Clean up build set configuration reporting.
Diffstat (limited to 'source-builder/sb/setbuilder.py')
-rw-r--r--source-builder/sb/setbuilder.py38
1 files changed, 20 insertions, 18 deletions
diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index 800e09d..801341e 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -58,6 +58,18 @@ def _notice(opts, text):
log.output(text)
log.flush()
+def find_config(config, configs):
+ if config.endswith('.bset') or config.endswith('.cfg'):
+ names = [config]
+ else:
+ names = ['%s.cfg' % (path.basename(config)),
+ '%s.bset' % (path.basename(config))]
+ for c in configs['files']:
+ if path.basename(c) in names:
+ if path.dirname(c).endswith(path.dirname(config)):
+ return c
+ return None
+
class buildset:
"""Build a set builds a set of packages."""
@@ -74,18 +86,6 @@ class buildset:
if not self.opts.quiet():
log.output(text)
- def find_config(self, config):
- if config.endswith('.bset') or config.endswith('.cfg'):
- names = [config]
- else:
- names = ['%s.cfg' % (path.basename(config)),
- '%s.bset' % (path.basename(config))]
- for c in self.configs['files']:
- if path.basename(c) in names:
- if path.dirname(c).endswith(path.dirname(config)):
- return c
- return None
-
def copy(self, src, dst):
if not os.path.isdir(path.host(src)):
raise error.general('copying tree: no source directory: %s' % (path.host(src)))
@@ -100,7 +100,7 @@ class buildset:
except distutils.errors.DistutilsFileError, err:
raise error.general('copying tree: %s' % (str(err)))
- def report(self, _config, tmproot):
+ def report(self, _config, _build):
if not self.opts.get_arg('--no-report'):
format = self.opts.get_arg('--report-format')
if format is None:
@@ -120,11 +120,13 @@ class buildset:
ext = '.html'
else:
raise error.general('invalid report format: %s' % (format[1]))
+ buildroot = _build.config.abspath('%{buildroot}')
prefix = self.opts.expand('%{_prefix}', self.defaults)
- outname = path.host(path.join(tmproot, prefix, path.splitext(path.basename(_config))[0] + ext))
- _notice(self.opts, 'reporting: %s -> %s' % (_config, outname))
+ name = path.splitext(path.basename(_config))[0] + ext
+ outname = path.host(path.join(buildroot, prefix, name))
+ _notice(self.opts, 'reporting: %s -> %s' % (_config, name))
if not self.opts.dry_run():
- r = report.report(format, self.configs, self.defaults)
+ r = reports.report(format, self.configs, self.defaults, self.opts)
r.make(_config, outname)
del r
@@ -230,7 +232,7 @@ class buildset:
raise error.general('invalid directive in build set files: %s' % (l))
else:
l = l.strip()
- c = self.find_config(l)
+ c = find_config(l, self.configs)
if c is None:
raise error.general('cannot find file: %s' % (l))
configs += [c]
@@ -289,8 +291,8 @@ class buildset:
if s == 0:
tmproot = self.first_package(b)
b.make()
+ self.report(configs[s], b)
self.every_package(b, tmproot)
- self.report(configs[s], tmproot)
if s == len(configs) - 1:
self.last_package(b, tmproot)
builds += [b]