mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Make the bset/cfg lister a function.
This commit is contained in:
parent
bcae849cf1
commit
d63f135f5d
@ -66,7 +66,7 @@ class buildset:
|
|||||||
if not self.opts.quiet():
|
if not self.opts.quiet():
|
||||||
log.output(text)
|
log.output(text)
|
||||||
|
|
||||||
def _find_config(self, config):
|
def find_config(self, config):
|
||||||
if config.endswith('.bset') or config.endswith('.cfg'):
|
if config.endswith('.bset') or config.endswith('.cfg'):
|
||||||
names = [config]
|
names = [config]
|
||||||
else:
|
else:
|
||||||
@ -194,7 +194,7 @@ class buildset:
|
|||||||
raise error.general('invalid directive in build set files: %s' % (l))
|
raise error.general('invalid directive in build set files: %s' % (l))
|
||||||
else:
|
else:
|
||||||
l = l.strip()
|
l = l.strip()
|
||||||
c = self._find_config(l)
|
c = self.find_config(l)
|
||||||
if c is None:
|
if c is None:
|
||||||
raise error.general('cannot find file: %s' % (l))
|
raise error.general('cannot find file: %s' % (l))
|
||||||
configs += [c]
|
configs += [c]
|
||||||
@ -280,6 +280,20 @@ class buildset:
|
|||||||
|
|
||||||
_notice(self.opts, 'Build Set: Time %s' % (str(end - start)))
|
_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():
|
def run():
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
@ -295,17 +309,7 @@ def run():
|
|||||||
if not check.host_setup(opts, _defaults):
|
if not check.host_setup(opts, _defaults):
|
||||||
raise error.general('host build environment is not set up correctly')
|
raise error.general('host build environment is not set up correctly')
|
||||||
configs = build.get_configs(opts, _defaults)
|
configs = build.get_configs(opts, _defaults)
|
||||||
if opts.get_arg('--list-configs') or opts.get_arg('--list-bsets'):
|
if not list_bset_cfg_files(opts, configs):
|
||||||
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:
|
|
||||||
for bset in opts.params():
|
for bset in opts.params():
|
||||||
b = buildset(bset, _configs = configs, _defaults = _defaults, opts = opts)
|
b = buildset(bset, _configs = configs, _defaults = _defaults, opts = opts)
|
||||||
b.build()
|
b.build()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user