mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Add a deps option to print the dependent config files.
This commit is contained in:
parent
984e4e6f39
commit
79f80fd979
@ -211,6 +211,7 @@ class file:
|
|||||||
if arg.startswith('--with-') or arg.startswith('--without-'):
|
if arg.startswith('--with-') or arg.startswith('--without-'):
|
||||||
label = arg[2:].lower().replace('-', '_')
|
label = arg[2:].lower().replace('-', '_')
|
||||||
self.default_defines[self._label(label)] = label
|
self.default_defines[self._label(label)] = label
|
||||||
|
self._includes = []
|
||||||
self.load_depth = 0
|
self.load_depth = 0
|
||||||
self.load(name)
|
self.load(name)
|
||||||
|
|
||||||
@ -778,6 +779,8 @@ class file:
|
|||||||
raise error.general('error opening config file: %s' % (path.host(configname)))
|
raise error.general('error opening config file: %s' % (path.host(configname)))
|
||||||
self.configpath += [configname]
|
self.configpath += [configname]
|
||||||
|
|
||||||
|
self._includes += [configname]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dir = None
|
dir = None
|
||||||
info = None
|
info = None
|
||||||
@ -886,6 +889,9 @@ class file:
|
|||||||
def packages(self):
|
def packages(self):
|
||||||
return self._packages
|
return self._packages
|
||||||
|
|
||||||
|
def includes(self):
|
||||||
|
return self._includes
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
|
@ -253,7 +253,7 @@ class buildset:
|
|||||||
|
|
||||||
return self.parse(bset)
|
return self.parse(bset)
|
||||||
|
|
||||||
def build(self):
|
def build(self, deps = None):
|
||||||
|
|
||||||
_trace(self.opts, '_bset:%s: make' % (self.bset))
|
_trace(self.opts, '_bset:%s: make' % (self.bset))
|
||||||
_notice(self.opts, 'Build Set: %s' % (self.bset))
|
_notice(self.opts, 'Build Set: %s' % (self.bset))
|
||||||
@ -282,7 +282,7 @@ class buildset:
|
|||||||
_configs = self.configs,
|
_configs = self.configs,
|
||||||
_defaults = _defaults,
|
_defaults = _defaults,
|
||||||
opts = _opts)
|
opts = _opts)
|
||||||
bs.build()
|
bs.build(deps)
|
||||||
del bs
|
del bs
|
||||||
elif configs[s].endswith('.cfg'):
|
elif configs[s].endswith('.cfg'):
|
||||||
b = build.build(configs[s],
|
b = build.build(configs[s],
|
||||||
@ -291,11 +291,14 @@ class buildset:
|
|||||||
opts = _opts)
|
opts = _opts)
|
||||||
if s == 0:
|
if s == 0:
|
||||||
tmproot = self.first_package(b)
|
tmproot = self.first_package(b)
|
||||||
|
if deps is None:
|
||||||
b.make()
|
b.make()
|
||||||
self.report(configs[s], b)
|
self.report(configs[s], b)
|
||||||
self.every_package(b, tmproot)
|
self.every_package(b, tmproot)
|
||||||
if s == len(configs) - 1:
|
if s == len(configs) - 1:
|
||||||
self.last_package(b, tmproot)
|
self.last_package(b, tmproot)
|
||||||
|
else:
|
||||||
|
deps += b.config.includes()
|
||||||
builds += [b]
|
builds += [b]
|
||||||
else:
|
else:
|
||||||
raise error.general('invalid config type: %s' % (configs[s]))
|
raise error.general('invalid config type: %s' % (configs[s]))
|
||||||
@ -304,7 +307,7 @@ class buildset:
|
|||||||
print gerr
|
print gerr
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
if not self.opts.no_clean() or self.opts.get_arg('--keep-going'):
|
if deps is None and (not self.opts.no_clean() or self.opts.get_arg('--keep-going')):
|
||||||
for b in builds:
|
for b in builds:
|
||||||
_notice(self.opts, 'cleaning: %s' % (b.name()))
|
_notice(self.opts, 'cleaning: %s' % (b.name()))
|
||||||
b.cleanup()
|
b.cleanup()
|
||||||
@ -339,6 +342,7 @@ def run():
|
|||||||
try:
|
try:
|
||||||
optargs = { '--list-configs': 'List available configurations',
|
optargs = { '--list-configs': 'List available configurations',
|
||||||
'--list-bsets': 'List available build sets',
|
'--list-bsets': 'List available build sets',
|
||||||
|
'--list-deps': 'List the dependent files.',
|
||||||
'--keep-going': 'Do not stop on error.',
|
'--keep-going': 'Do not stop on error.',
|
||||||
'--no-install': 'Do not install the packages to the prefix.',
|
'--no-install': 'Do not install the packages to the prefix.',
|
||||||
'--no-report': 'Do not create a package report.',
|
'--no-report': 'Do not create a package report.',
|
||||||
@ -351,11 +355,20 @@ 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-deps'):
|
||||||
|
deps = []
|
||||||
|
else:
|
||||||
|
deps = None
|
||||||
if not list_bset_cfg_files(opts, configs):
|
if not list_bset_cfg_files(opts, configs):
|
||||||
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(deps)
|
||||||
del b
|
del b
|
||||||
|
if deps is not None:
|
||||||
|
c = 0
|
||||||
|
for d in sorted(set(deps)):
|
||||||
|
c += 1
|
||||||
|
print 'dep[%d]: %s' % (c, d)
|
||||||
except error.general, gerr:
|
except error.general, gerr:
|
||||||
print gerr
|
print gerr
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user