Surround each portion of the log with escape sequences to display it
in color on the terminal.
+ -C, --commit
+ Create a git commit with the changes when the operation is complete. A
+ standard commit message is used which may need to be edited.
+
-d, --defconfigs
Specify a file containing a list of defconfigs to move
-v, --verbose
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
$ tools/moveconfig.py -h
configs: A list of CONFIGs to remove.
options: option flags.
"""
- while True:
- choice = raw_input('Clean up headers? [y/n]: ').lower()
- print choice
- if choice == 'y' or choice == 'n':
- break
+ if not options.yes:
+ while True:
+ choice = raw_input('Clean up headers? [y/n]: ').lower()
+ print choice
+ if choice == 'y' or choice == 'n':
+ break
- if choice == 'n':
- return
+ if choice == 'n':
+ return
patterns = []
for config in configs:
configs: A list of CONFIGs to remove.
options: option flags.
"""
- while True:
- choice = raw_input('Clean up CONFIG_SYS_EXTRA_OPTIONS? [y/n]: ').lower()
- print choice
- if choice == 'y' or choice == 'n':
- break
+ if not options.yes:
+ while True:
+ choice = (raw_input('Clean up CONFIG_SYS_EXTRA_OPTIONS? [y/n]: ').
+ lower())
+ print choice
+ if choice == 'y' or choice == 'n':
+ break
- if choice == 'n':
- return
+ if choice == 'n':
+ return
configs = [ config[len('CONFIG_'):] for config in configs ]
# Add options here
parser.add_option('-c', '--color', action='store_true', default=False,
help='display the log in color')
+ parser.add_option('-C', '--commit', action='store_true', default=False,
+ help='Create a git commit for the operation')
parser.add_option('-d', '--defconfigs', type='string',
help='a file containing a list of defconfigs to move')
parser.add_option('-n', '--dry-run', action='store_true', default=False,
help='the number of jobs to run simultaneously')
parser.add_option('-r', '--git-ref', type='string',
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,
help='show any build errors as boards are built')
parser.usage += ' CONFIG ...'
cleanup_headers(configs, options)
cleanup_extra_options(configs, options)
+ if options.commit:
+ subprocess.call(['git', 'add', '-u'])
+ if configs:
+ msg = 'Convert %s %sto Kconfig' % (configs[0],
+ 'et al ' if len(configs) > 1 else '')
+ msg += ('\n\nThis converts the following to Kconfig:\n %s\n' %
+ '\n '.join(configs))
+ else:
+ msg = 'configs: Resync with savedefconfig'
+ msg += '\n\nRsync all defconfig files using moveconfig.py'
+ subprocess.call(['git', 'commit', '-s', '-m', msg])
+
if __name__ == '__main__':
main()