History

checkkconfigsymbols.py: fix sorted output

Commit b1a3f243485f ("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.

Valentin Rothberg committed 11 years ago

Commit e9533ae1 parent a0871461 file · +7 −5Browse files

Unified · Split

scripts/checkkconfigsymbols.py+7−5
@@ -112,14 +112,15 @@ def main(): · 111 unmodified lines
112 undefined_b = check_symbols()112 undefined_b = check_symbols()
113 113
114 # report cases that are present for the commit but not before114 # report cases that are present for the commit but not before
115 for feature in undefined_b:115 for feature in sorted(undefined_b):
116 # feature has not been undefined before116 # feature has not been undefined before
117 if not feature in undefined_a:117 if not feature in undefined_a:
118 files = undefined_b.get(feature)118 files = sorted(undefined_b.get(feature))
119 print "%s\t%s" % (feature, ", ".join(files))119 print "%s\t%s" % (feature, ", ".join(files))
120 # check if there are new files that reference the undefined feature120 # check if there are new files that reference the undefined feature
121 else:121 else:
122 files = undefined_b.get(feature) - undefined_a.get(feature)122 files = sorted(undefined_b.get(feature) -
123 undefined_a.get(feature))
123 if files:124 if files:
124 print "%s\t%s" % (feature, ", ".join(files))125 print "%s\t%s" % (feature, ", ".join(files))
125 126
@@ -129,8 +130,9 @@ def main(): · 3 unmodified lines
129 # default to check the entire tree130 # default to check the entire tree
130 else:131 else:
131 undefined = check_symbols()132 undefined = check_symbols()
132 for feature in undefined:133 for feature in sorted(undefined):
133 files = undefined.get(feature)134 files = sorted(undefined.get(feature))
135 print "%s\t%s" % (feature, ", ".join(files))
134 136
135 137
136def execute(cmd):138def execute(cmd):