tools: moveconfig: make getting all defconfigs into helper function
I want to reuse this routine in the next commit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
a3a779f7f7
commit
684c306ec4
|
@ -266,6 +266,16 @@ def get_make_cmd():
|
||||||
sys.exit('GNU Make not found')
|
sys.exit('GNU Make not found')
|
||||||
return ret[0].rstrip()
|
return ret[0].rstrip()
|
||||||
|
|
||||||
|
def get_all_defconfigs():
|
||||||
|
"""Get all the defconfig files under the configs/ directory."""
|
||||||
|
defconfigs = []
|
||||||
|
for (dirpath, dirnames, filenames) in os.walk('configs'):
|
||||||
|
dirpath = dirpath[len('configs') + 1:]
|
||||||
|
for filename in fnmatch.filter(filenames, '*_defconfig'):
|
||||||
|
defconfigs.append(os.path.join(dirpath, filename))
|
||||||
|
|
||||||
|
return defconfigs
|
||||||
|
|
||||||
def color_text(color_enabled, color, string):
|
def color_text(color_enabled, color, string):
|
||||||
"""Return colored string."""
|
"""Return colored string."""
|
||||||
if color_enabled:
|
if color_enabled:
|
||||||
|
@ -1079,12 +1089,7 @@ def move_config(configs, options):
|
||||||
sys.exit('%s - defconfig does not exist. Stopping.' %
|
sys.exit('%s - defconfig does not exist. Stopping.' %
|
||||||
defconfigs[i])
|
defconfigs[i])
|
||||||
else:
|
else:
|
||||||
# All the defconfig files to be processed
|
defconfigs = get_all_defconfigs()
|
||||||
defconfigs = []
|
|
||||||
for (dirpath, dirnames, filenames) in os.walk('configs'):
|
|
||||||
dirpath = dirpath[len('configs') + 1:]
|
|
||||||
for filename in fnmatch.filter(filenames, '*_defconfig'):
|
|
||||||
defconfigs.append(os.path.join(dirpath, filename))
|
|
||||||
|
|
||||||
progress = Progress(len(defconfigs))
|
progress = Progress(len(defconfigs))
|
||||||
slots = Slots(configs, options, progress, reference_src_dir)
|
slots = Slots(configs, options, progress, reference_src_dir)
|
||||||
|
|
Loading…
Reference in New Issue