summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/setbuilder.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2013-02-28 20:43:33 +1100
committerChris Johns <chrisj@rtems.org>2013-02-28 20:43:33 +1100
commitd63f135f5d054be08227fa9f8dd3a19373c838dd (patch)
tree8843bcd791b7c46ee550084b6bd31d7254e01ea8 /source-builder/sb/setbuilder.py
parentCleanup the %setup flags (diff)
downloadrtems-source-builder-d63f135f5d054be08227fa9f8dd3a19373c838dd.tar.bz2
Make the bset/cfg lister a function.
Diffstat (limited to 'source-builder/sb/setbuilder.py')
-rw-r--r--source-builder/sb/setbuilder.py30
1 files changed, 17 insertions, 13 deletions
diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index dc54e70..d838ebe 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -66,7 +66,7 @@ class buildset:
if not self.opts.quiet():
log.output(text)
- def _find_config(self, config):
+ def find_config(self, config):
if config.endswith('.bset') or config.endswith('.cfg'):
names = [config]
else:
@@ -194,7 +194,7 @@ class buildset:
raise error.general('invalid directive in build set files: %s' % (l))
else:
l = l.strip()
- c = self._find_config(l)
+ c = self.find_config(l)
if c is None:
raise error.general('cannot find file: %s' % (l))
configs += [c]
@@ -280,6 +280,20 @@ class buildset:
_notice(self.opts, 'Build Set: Time %s' % (str(end - start)))
+def list_bset_cfg_files(opts, configs):
+ if opts.get_arg('--list-configs') or opts.get_arg('--list-bsets'):
+ if opts.get_arg('--list-configs'):
+ ext = '.cfg'
+ else:
+ ext = '.bset'
+ for p in configs['paths']:
+ print 'Examining: %s' % (os.path.relpath(p))
+ for c in configs['files']:
+ if c.endswith(ext):
+ print ' %s' % (c)
+ return True
+ return False
+
def run():
import sys
try:
@@ -295,17 +309,7 @@ def run():
if not check.host_setup(opts, _defaults):
raise error.general('host build environment is not set up correctly')
configs = build.get_configs(opts, _defaults)
- if opts.get_arg('--list-configs') or opts.get_arg('--list-bsets'):
- if opts.get_arg('--list-configs'):
- ext = '.cfg'
- else:
- ext = '.bset'
- for p in configs['paths']:
- print 'Examining: %s' % (os.path.relpath(p))
- for c in configs['files']:
- if c.endswith(ext):
- print ' %s' % (c)
- else:
+ if not list_bset_cfg_files(opts, configs):
for bset in opts.params():
b = buildset(bset, _configs = configs, _defaults = _defaults, opts = opts)
b.build()