mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-09-21 07:01:57 +00:00
moveconfig: Add an option to skip prompts
At present it is not easy to use moveconfig from a script since it asks for user input a few times. Add a -y option to skip this and assume that 'y' was entered. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
14476ddee2
commit
6b403dfd2e
1 changed files with 23 additions and 14 deletions
|
@ -162,6 +162,10 @@ Available options
|
||||||
-v, --verbose
|
-v, --verbose
|
||||||
Show any build errors as boards are built
|
Show any build errors as boards are built
|
||||||
|
|
||||||
|
-y, --yes
|
||||||
|
Instead of prompting, automatically go ahead with all operations. This
|
||||||
|
includes cleaning up headers and CONFIG_SYS_EXTRA_OPTIONS.
|
||||||
|
|
||||||
To see the complete list of supported options, run
|
To see the complete list of supported options, run
|
||||||
|
|
||||||
$ tools/moveconfig.py -h
|
$ tools/moveconfig.py -h
|
||||||
|
@ -481,14 +485,15 @@ def cleanup_headers(configs, options):
|
||||||
configs: A list of CONFIGs to remove.
|
configs: A list of CONFIGs to remove.
|
||||||
options: option flags.
|
options: option flags.
|
||||||
"""
|
"""
|
||||||
while True:
|
if not options.yes:
|
||||||
choice = raw_input('Clean up headers? [y/n]: ').lower()
|
while True:
|
||||||
print choice
|
choice = raw_input('Clean up headers? [y/n]: ').lower()
|
||||||
if choice == 'y' or choice == 'n':
|
print choice
|
||||||
break
|
if choice == 'y' or choice == 'n':
|
||||||
|
break
|
||||||
|
|
||||||
if choice == 'n':
|
if choice == 'n':
|
||||||
return
|
return
|
||||||
|
|
||||||
patterns = []
|
patterns = []
|
||||||
for config in configs:
|
for config in configs:
|
||||||
|
@ -560,14 +565,16 @@ def cleanup_extra_options(configs, options):
|
||||||
configs: A list of CONFIGs to remove.
|
configs: A list of CONFIGs to remove.
|
||||||
options: option flags.
|
options: option flags.
|
||||||
"""
|
"""
|
||||||
while True:
|
if not options.yes:
|
||||||
choice = raw_input('Clean up CONFIG_SYS_EXTRA_OPTIONS? [y/n]: ').lower()
|
while True:
|
||||||
print choice
|
choice = (raw_input('Clean up CONFIG_SYS_EXTRA_OPTIONS? [y/n]: ').
|
||||||
if choice == 'y' or choice == 'n':
|
lower())
|
||||||
break
|
print choice
|
||||||
|
if choice == 'y' or choice == 'n':
|
||||||
|
break
|
||||||
|
|
||||||
if choice == 'n':
|
if choice == 'n':
|
||||||
return
|
return
|
||||||
|
|
||||||
configs = [ config[len('CONFIG_'):] for config in configs ]
|
configs = [ config[len('CONFIG_'):] for config in configs ]
|
||||||
|
|
||||||
|
@ -1251,6 +1258,8 @@ def main():
|
||||||
help='the number of jobs to run simultaneously')
|
help='the number of jobs to run simultaneously')
|
||||||
parser.add_option('-r', '--git-ref', type='string',
|
parser.add_option('-r', '--git-ref', type='string',
|
||||||
help='the git ref to clone for building the autoconf.mk')
|
help='the git ref to clone for building the autoconf.mk')
|
||||||
|
parser.add_option('-y', '--yes', action='store_true', default=False,
|
||||||
|
help="respond 'yes' to any prompts")
|
||||||
parser.add_option('-v', '--verbose', action='store_true', default=False,
|
parser.add_option('-v', '--verbose', action='store_true', default=False,
|
||||||
help='show any build errors as boards are built')
|
help='show any build errors as boards are built')
|
||||||
parser.usage += ' CONFIG ...'
|
parser.usage += ' CONFIG ...'
|
||||||
|
|
Loading…
Reference in a new issue