mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Move find_configs to build and fix. Install reports to 'rtems-source-builder'.
This commit is contained in:
parent
43c3d0abb7
commit
0759d98628
@ -467,6 +467,18 @@ def get_configs(opts, _defaults):
|
|||||||
configs['files'] = sorted(configs['files'])
|
configs['files'] = sorted(configs['files'])
|
||||||
return configs
|
return configs
|
||||||
|
|
||||||
|
def find_config(config, configs):
|
||||||
|
config_root, config_ext = path.splitext(config)
|
||||||
|
if config_ext not in ['', '.bset', '.cfg']:
|
||||||
|
config_root = config
|
||||||
|
config_ext = ''
|
||||||
|
for c in configs['files']:
|
||||||
|
r, e = path.splitext(c)
|
||||||
|
if config_root == r:
|
||||||
|
if config_ext == '' or config_ext == e:
|
||||||
|
return c
|
||||||
|
return None
|
||||||
|
|
||||||
def run(args):
|
def run(args):
|
||||||
try:
|
try:
|
||||||
optargs = { '--list-configs': 'List available configurations' }
|
optargs = { '--list-configs': 'List available configurations' }
|
||||||
|
@ -304,7 +304,7 @@ class report:
|
|||||||
def make(self, inname, outname, intro_text = None):
|
def make(self, inname, outname, intro_text = None):
|
||||||
self.setup()
|
self.setup()
|
||||||
self.introduction(inname, intro_text)
|
self.introduction(inname, intro_text)
|
||||||
config = setbuilder.find_config(inname, self.configs)
|
config = build.find_config(inname, self.configs)
|
||||||
if config is None:
|
if config is None:
|
||||||
raise error.general('config file not found: %s' % (inname))
|
raise error.general('config file not found: %s' % (inname))
|
||||||
if config.endswith('.bset'):
|
if config.endswith('.bset'):
|
||||||
|
@ -58,18 +58,6 @@ def _notice(opts, text):
|
|||||||
log.output(text)
|
log.output(text)
|
||||||
log.flush()
|
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:
|
class buildset:
|
||||||
"""Build a set builds a set of packages."""
|
"""Build a set builds a set of packages."""
|
||||||
|
|
||||||
@ -123,9 +111,11 @@ class buildset:
|
|||||||
buildroot = _build.config.abspath('%{buildroot}')
|
buildroot = _build.config.abspath('%{buildroot}')
|
||||||
prefix = self.opts.expand('%{_prefix}', self.defaults)
|
prefix = self.opts.expand('%{_prefix}', self.defaults)
|
||||||
name = path.splitext(path.basename(_config))[0] + ext
|
name = path.splitext(path.basename(_config))[0] + ext
|
||||||
outname = path.host(path.join(buildroot, prefix, name))
|
outpath = path.host(path.join(buildroot, prefix, 'rtems-source-builder'))
|
||||||
|
outname = path.host(path.join(outpath, name))
|
||||||
_notice(self.opts, 'reporting: %s -> %s' % (_config, name))
|
_notice(self.opts, 'reporting: %s -> %s' % (_config, name))
|
||||||
if not self.opts.dry_run():
|
if not self.opts.dry_run():
|
||||||
|
_build.mkdir(outpath)
|
||||||
r = reports.report(format, self.configs, self.defaults, self.opts)
|
r = reports.report(format, self.configs, self.defaults, self.opts)
|
||||||
r.make(_config, outname)
|
r.make(_config, outname)
|
||||||
del r
|
del r
|
||||||
@ -232,7 +222,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 = find_config(l, self.configs)
|
c = build.find_config(l, self.configs)
|
||||||
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]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user