mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Listing options now handle nested directories.
This commit is contained in:
parent
73e8afb106
commit
e908afb868
@ -461,12 +461,22 @@ class build:
|
||||
return package.name()
|
||||
|
||||
def list_configs(opts, _defaults, ext = '.cfg'):
|
||||
|
||||
def _scan(_path, ext):
|
||||
configs = []
|
||||
for root, dirs, files in os.walk(_path):
|
||||
prefix = root[len(_path) + 1:]
|
||||
for file in files:
|
||||
if file.endswith(ext):
|
||||
configs += [path.join(prefix, file)]
|
||||
return configs
|
||||
|
||||
configs = []
|
||||
for cp in opts.expand('%{_configdir}', _defaults).split(':'):
|
||||
print 'Examining: %s' % (path.host(path.abspath(cp)))
|
||||
configs += glob.glob(path.host(path.join(cp, '*%s' % (ext))))
|
||||
configs += _scan(cp, ext)
|
||||
for c in sorted(configs):
|
||||
config = path.basename(c)
|
||||
config = c # path.basename(c)
|
||||
if config.endswith(ext):
|
||||
config = config[:0 - len(ext)]
|
||||
print ' ', config
|
||||
|
Loading…
x
Reference in New Issue
Block a user