mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
checkkconfigsymbols.py: colored output
Color output to make it more readable. Symbols will be printed yellow, relevant commits (see --find) red. Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Acked-by: Stefan Hengelein <stefan.hengelein@fau.de> Acked-by: Andreas Ruprecht <andreas.ruprecht@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a42fa92ce7
commit
c745566306
1 changed files with 20 additions and 6 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
"""Find Kconfig symbols that are referenced but not defined."""
|
"""Find Kconfig symbols that are referenced but not defined."""
|
||||||
|
|
||||||
# (c) 2014-2015 Valentin Rothberg <Valentin.Rothberg@lip6.fr>
|
# (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com>
|
||||||
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
|
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
|
||||||
#
|
#
|
||||||
# Licensed under the terms of the GNU GPL License version 2
|
# Licensed under the terms of the GNU GPL License version 2
|
||||||
|
@ -136,19 +136,19 @@ def main():
|
||||||
# feature has not been undefined before
|
# feature has not been undefined before
|
||||||
if not feature in undefined_a:
|
if not feature in undefined_a:
|
||||||
files = sorted(undefined_b.get(feature))
|
files = sorted(undefined_b.get(feature))
|
||||||
print "%s\t%s" % (feature, ", ".join(files))
|
print "%s\t%s" % (yel(feature), ", ".join(files))
|
||||||
if opts.find:
|
if opts.find:
|
||||||
commits = find_commits(feature, opts.diff)
|
commits = find_commits(feature, opts.diff)
|
||||||
print commits
|
print red(commits)
|
||||||
# check if there are new files that reference the undefined feature
|
# check if there are new files that reference the undefined feature
|
||||||
else:
|
else:
|
||||||
files = sorted(undefined_b.get(feature) -
|
files = sorted(undefined_b.get(feature) -
|
||||||
undefined_a.get(feature))
|
undefined_a.get(feature))
|
||||||
if files:
|
if files:
|
||||||
print "%s\t%s" % (feature, ", ".join(files))
|
print "%s\t%s" % (yel(feature), ", ".join(files))
|
||||||
if opts.find:
|
if opts.find:
|
||||||
commits = find_commits(feature, opts.diff)
|
commits = find_commits(feature, opts.diff)
|
||||||
print commits
|
print red(commits)
|
||||||
|
|
||||||
# reset to head
|
# reset to head
|
||||||
execute("git reset --hard %s" % head)
|
execute("git reset --hard %s" % head)
|
||||||
|
@ -158,7 +158,21 @@ def main():
|
||||||
undefined = check_symbols(opts.ignore)
|
undefined = check_symbols(opts.ignore)
|
||||||
for feature in sorted(undefined):
|
for feature in sorted(undefined):
|
||||||
files = sorted(undefined.get(feature))
|
files = sorted(undefined.get(feature))
|
||||||
print "%s\t%s" % (feature, ", ".join(files))
|
print "%s\t%s" % (yel(feature), ", ".join(files))
|
||||||
|
|
||||||
|
|
||||||
|
def yel(string):
|
||||||
|
"""
|
||||||
|
Color %string yellow.
|
||||||
|
"""
|
||||||
|
return "\033[33m%s\033[0m" % string
|
||||||
|
|
||||||
|
|
||||||
|
def red(string):
|
||||||
|
"""
|
||||||
|
Color %string red.
|
||||||
|
"""
|
||||||
|
return "\033[31m%s\033[0m" % string
|
||||||
|
|
||||||
|
|
||||||
def execute(cmd):
|
def execute(cmd):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue