diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 08:34:25 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 08:34:25 -0700 |
commit | 5b4197845ad1a33bc57da7ee5ea41de58c2f86bf (patch) | |
tree | 87139e25612c78431584f953053ae81ead30b27b /scripts/diffconfig | |
parent | a22a0fdba4191473581f86c9dd5361cf581521d3 (diff) | |
parent | e062781397e5bebc6c1b8dd4bf466136e13ae4c5 (diff) |
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig updates from Michal Marek:
"This is the kconfig part of kbuild for v3.12-rc1:
- post-3.11 search code fixes and micro-optimizations
- CONFIG_MODULES is no longer a special case; this is needed to
eventually fix the bug that using KCONFIG_ALLCONFIG breaks
allmodconfig
- long long is used to store hex and int values
- make silentoldconfig no longer warns when a symbol changes from
tristate to bool (it's a job for make oldconfig)
- scripts/diffconfig updated to work with newer Pythons
- scripts/config does not rely on GNU sed extensions"
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
kconfig: do not allow more than one symbol to have 'option modules'
kconfig: regenerate bison parser
kconfig: do not special-case 'MODULES' symbol
diffconfig: Update script to support python versions 2.5 through 3.3
diffconfig: Gracefully exit if the default config files are not present
modules: do not depend on kconfig to set 'modules' option to symbol MODULES
kconfig: silence warning when parsing auto.conf when a symbol has changed type
scripts/config: use sed's POSIX interface
kconfig: switch to "long long" for sanity
kconfig: simplify symbol-search code
kconfig: don't allocate n+1 elements in temporary array
kconfig: minor style fixes in symbol-search code
kconfig/[mn]conf: shorten title in search-box
kconfig: avoid multiple calls to strlen
Documentation/kconfig: more concise and straightforward search explanation
Diffstat (limited to 'scripts/diffconfig')
-rwxr-xr-x | scripts/diffconfig | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/scripts/diffconfig b/scripts/diffconfig index b91f3e34d44d..6d672836e187 100755 --- a/scripts/diffconfig +++ b/scripts/diffconfig @@ -10,7 +10,7 @@ import sys, os def usage(): - print """Usage: diffconfig [-h] [-m] [<config1> <config2>] + print("""Usage: diffconfig [-h] [-m] [<config1> <config2>] Diffconfig is a simple utility for comparing two .config files. Using standard diff to compare .config files often includes extraneous and @@ -33,7 +33,7 @@ Example usage: EXT2_FS y -> n LOG_BUF_SHIFT 14 -> 16 PRINTK_TIME n -> y -""" +""") sys.exit(0) # returns a dictionary of name/value pairs for config items in the file @@ -54,23 +54,23 @@ def print_config(op, config, value, new_value): if merge_style: if new_value: if new_value=="n": - print "# CONFIG_%s is not set" % config + print("# CONFIG_%s is not set" % config) else: - print "CONFIG_%s=%s" % (config, new_value) + print("CONFIG_%s=%s" % (config, new_value)) else: if op=="-": - print "-%s %s" % (config, value) + print("-%s %s" % (config, value)) elif op=="+": - print "+%s %s" % (config, new_value) + print("+%s %s" % (config, new_value)) else: - print " %s %s -> %s" % (config, value, new_value) + print(" %s %s -> %s" % (config, value, new_value)) def main(): global merge_style # parse command line args if ("-h" in sys.argv or "--help" in sys.argv): - usage() + usage() merge_style = 0 if "-m" in sys.argv: @@ -79,23 +79,27 @@ def main(): argc = len(sys.argv) if not (argc==1 or argc == 3): - print "Error: incorrect number of arguments or unrecognized option" + print("Error: incorrect number of arguments or unrecognized option") usage() if argc == 1: # if no filenames given, assume .config and .config.old build_dir="" - if os.environ.has_key("KBUILD_OUTPUT"): + if "KBUILD_OUTPUT" in os.environ: build_dir = os.environ["KBUILD_OUTPUT"]+"/" - configa_filename = build_dir + ".config.old" configb_filename = build_dir + ".config" else: configa_filename = sys.argv[1] configb_filename = sys.argv[2] - a = readconfig(file(configa_filename)) - b = readconfig(file(configb_filename)) + try: + a = readconfig(open(configa_filename)) + b = readconfig(open(configb_filename)) + except (IOError): + e = sys.exc_info()[1] + print("I/O error[%s]: %s\n" % (e.args[0],e.args[1])) + usage() # print items in a but not b (accumulate, sort and print) old = [] @@ -121,8 +125,7 @@ def main(): # now print items in b but not in a # (items from b that were in a were removed above) - new = b.keys() - new.sort() + new = sorted(b.keys()) for config in new: print_config("+", config, None, b[config]) |