@@ -356,7 +356,7 @@ def extend_matched_lines(lines, matched, pre_pattern, post_pattern, extend_pre,
matched += extended_matched
matched.sort()
-def cleanup_one_header(header_path, patterns, dry_run):
+def cleanup_one_header(header_path, patterns, options):
"""Clean regex-matched lines away from a file.
Arguments:
@@ -406,16 +406,17 @@ def cleanup_one_header(header_path, patterns, dry_run):
tofile=os.path.join('b', header_path))
for line in diff:
- print line,
+ print color_text(options.color and line[0] == '-' and line[1] != '-',
+ COLOR_LIGHT_RED, line),
- if dry_run:
+ if options.dry_run:
return
with open(header_path, 'w') as f:
for line in tolines:
f.write(line)
-def cleanup_headers(configs, dry_run):
+def cleanup_headers(configs, options):
"""Delete config defines from board headers.
Arguments:
@@ -441,7 +442,7 @@ def cleanup_headers(configs, dry_run):
for filename in filenames:
if not fnmatch.fnmatch(filename, '*~'):
cleanup_one_header(os.path.join(dirpath, filename),
- patterns, dry_run)
+ patterns, options)
### classes ###
class Progress:
@@ -1115,7 +1116,7 @@ def main():
move_config(configs, options)
if configs:
- cleanup_headers(configs, options.dry_run)
+ cleanup_headers(configs, options)
if __name__ == '__main__':
main()
This commit makes the tool show the cleaned lines in red if the --color option is given. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> --- tools/moveconfig.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot