sb/track: Add a command to track build sets.

- Process a build set for a range of hosts and output a dependency
  tree, the used build set and configuration files.
- Output the configuration files that are no referenced

Closes #4036
This commit is contained in:
Chris Johns
2020-08-10 14:49:49 +10:00
parent cc107b53da
commit 12418190b9
11 changed files with 1068 additions and 603 deletions

View File

@@ -635,6 +635,10 @@ class build:
return 0
return package.get_size('installed')
def includes(self):
if self.config:
return self.config.includes()
def get_configs(opts):
def _scan(_path, ext):
@@ -648,10 +652,17 @@ def get_configs(opts):
return configs
configs = { 'paths': [], 'files': [] }
for cp in opts.defaults.expand('%{_configdir}').split(':'):
paths = opts.defaults.expand('%{_configdir}').split(':')
root = path.host(os.path.commonprefix(paths))
configs['root'] = root
configs['localpaths'] = [lp[len(root):] for lp in paths]
for cp in paths:
hcp = path.host(path.abspath(cp))
configs['paths'] += [hcp]
configs['files'] += _scan(hcp, ['.cfg', '.bset'])
hpconfigs = sorted(set(_scan(hcp, ['.cfg', '.bset'])))
hcplocal = hcp[len(root):]
configs[hcplocal] = [path.join(hcplocal, c) for c in hpconfigs]
configs['files'] += hpconfigs
configs['files'] = sorted(set(configs['files']))
return configs