X-Git-Url: http://git.ipfire.org/?p=ipfire-3.x.git;a=blobdiff_plain;f=kernel%2Fscripts%2Fconfigdiff.py;h=ef938666a2deecd6e652c43bf8fd987a487d4421;hp=166acd747c3e916fe7703527bfdd8ecaffa1b17e;hb=2b86e6fb751ec76d236f08e45f5d32b739e2c464;hpb=dc125ed4b4d6020355a2aa9b518bbe968b195532 diff --git a/kernel/scripts/configdiff.py b/kernel/scripts/configdiff.py index 166acd747..ef938666a 100755 --- a/kernel/scripts/configdiff.py +++ b/kernel/scripts/configdiff.py @@ -36,17 +36,36 @@ f.close() f = open(filelist[1]) +printed_sections = [] section = None for line in f.readlines(): - m = re.match("^# (.*)$", line) + line = line.rstrip() + + # Ignore some stuff + if not line or line == "#": + continue + + if line.startswith("# Automatically generated file;"): + continue + + if line.endswith("Kernel Configuration"): + continue + + # End of section + m = re.match("# end of (.*)$", line) if m: _section = m.group(1) - if not _section.startswith("CONFIG_") and \ - not _section.endswith("Kernel Configuration") and \ - not _section.startswith("Automatically generated file;"): - section = _section - elif not line: - section = None + + if _section in printed_sections: + print "# end of %s" % _section + + continue + + # New section + m = re.match("^# (.*)$", line) + if m and not "CONFIG_" in line: + section = m.group(1) + continue option = None value = None @@ -71,12 +90,12 @@ for line in f.readlines(): option_value = "%s=%s" % (option, value) if not option_value in options: - if section: + if section and not section in printed_sections: print print "#" print "# %s" % section print "#" - section = None + printed_sections.append(section) if value == "n": print "# %s is not set" % option