Skip to content

Commit

Permalink
checkkconfigsymbols.py: fix sorted output
Browse files Browse the repository at this point in the history
Commit b1a3f24 ("checkkconfigsymbols.py: make it Git aware")
mistakenly removed to print undefined Kconfig symbols in alphabetical
order.  Furthermore, the script does not print anything anymore when the
entire tree is checked (i.e., when no commit is specified).

This patch restores the sorted output and adds the missing print for the
default case.  Additionally, the file lists are now sorted as well which
(a) makes it easier to read and (b) makes the output deterministic.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
vrothberg authored and gregkh committed Mar 24, 2015
1 parent a087146 commit e9533ae
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/checkkconfigsymbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ def main():
undefined_b = check_symbols()

# report cases that are present for the commit but not before
for feature in undefined_b:
for feature in sorted(undefined_b):
# feature has not been undefined before
if not feature in undefined_a:
files = undefined_b.get(feature)
files = sorted(undefined_b.get(feature))
print "%s\t%s" % (feature, ", ".join(files))
# check if there are new files that reference the undefined feature
else:
files = undefined_b.get(feature) - undefined_a.get(feature)
files = sorted(undefined_b.get(feature) -
undefined_a.get(feature))
if files:
print "%s\t%s" % (feature, ", ".join(files))

Expand All @@ -129,8 +130,9 @@ def main():
# default to check the entire tree
else:
undefined = check_symbols()
for feature in undefined:
files = undefined.get(feature)
for feature in sorted(undefined):
files = sorted(undefined.get(feature))
print "%s\t%s" % (feature, ", ".join(files))


def execute(cmd):
Expand Down

0 comments on commit e9533ae

Please sign in to comment.