提交 6a9f79f7 编写于 作者: M Masahiro Yamada

tools: moveconfig: allow to run without any CONFIG specified

I found "tools/moveconfig -s" might be useful for defconfig re-sync.
I could optimize it for re-sync if I wanted, but I do not want to
make the code complex for this feature.
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: NJoe Hershberger <joe.hershberger@ni.com>
上级 8513dc04
...@@ -839,10 +839,13 @@ def move_config(configs, options): ...@@ -839,10 +839,13 @@ def move_config(configs, options):
options: option flags options: option flags
""" """
if len(configs) == 0: if len(configs) == 0:
print 'Nothing to do. exit.' if options.force_sync:
sys.exit(0) print 'No CONFIG is specified. You are probably syncing defconfigs.',
else:
print 'Move %s (jobs: %d)' % (', '.join(configs), options.jobs) print 'Neither CONFIG nor --force-sync is specified. Nothing will happen.',
else:
print 'Move ' + ', '.join(configs),
print '(jobs: %d)\n' % options.jobs
if options.defconfigs: if options.defconfigs:
defconfigs = [line.strip() for line in open(options.defconfigs)] defconfigs = [line.strip() for line in open(options.defconfigs)]
...@@ -909,7 +912,7 @@ def main(): ...@@ -909,7 +912,7 @@ def main():
(options, configs) = parser.parse_args() (options, configs) = parser.parse_args()
if len(configs) == 0: if len(configs) == 0 and not options.force_sync:
parser.print_usage() parser.print_usage()
sys.exit(1) sys.exit(1)
...@@ -926,6 +929,7 @@ def main(): ...@@ -926,6 +929,7 @@ def main():
if not options.cleanup_headers_only: if not options.cleanup_headers_only:
move_config(configs, options) move_config(configs, options)
if configs:
cleanup_headers(configs, options.dry_run) cleanup_headers(configs, options.dry_run)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册