diff options
Diffstat (limited to 'source-builder/sb/build.py')
-rw-r--r-- | source-builder/sb/build.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source-builder/sb/build.py b/source-builder/sb/build.py index ceb179a..cfb7d8c 100644 --- a/source-builder/sb/build.py +++ b/source-builder/sb/build.py @@ -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 |