* [PATCH] kconfig: Make diffconfig work with Python 3 @ 2013-08-09 12:27 Johannes Thumshirn 2013-08-09 12:30 ` Sam Ravnborg 2013-08-28 14:29 ` Tim Bird 0 siblings, 2 replies; 6+ messages in thread From: Johannes Thumshirn @ 2013-08-09 12:27 UTC (permalink / raw) To: Tim Bird; +Cc: Sam Ravnborg, linux-kernel, johannes.thumshirn Adjust diffconfig to run cleanly on Python 3 (Tested with 3.3.2) and Python 2 (2.7.5) Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> --- scripts/diffconfig | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/diffconfig b/scripts/diffconfig index b91f3e3..dd0e75b 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,13 +79,13 @@ 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" @@ -94,8 +94,8 @@ def main(): configa_filename = sys.argv[1] configb_filename = sys.argv[2] - a = readconfig(file(configa_filename)) - b = readconfig(file(configb_filename)) + a = readconfig(open(configa_filename)) + b = readconfig(open(configb_filename)) # print items in a but not b (accumulate, sort and print) old = [] @@ -121,7 +121,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 = list(b.keys()) new.sort() for config in new: print_config("+", config, None, b[config]) -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] kconfig: Make diffconfig work with Python 3 2013-08-09 12:27 [PATCH] kconfig: Make diffconfig work with Python 3 Johannes Thumshirn @ 2013-08-09 12:30 ` Sam Ravnborg 2013-08-28 14:29 ` Tim Bird 1 sibling, 0 replies; 6+ messages in thread From: Sam Ravnborg @ 2013-08-09 12:30 UTC (permalink / raw) To: Johannes Thumshirn; +Cc: Tim Bird, linux-kernel, linux-kbuild, Michal Marek Hi Johannes. Can you please resnd and include Michal Marek + kbuild mailing list. Both are added to this mail so you have the addresses. Sam On Fri, Aug 09, 2013 at 02:27:02PM +0200, Johannes Thumshirn wrote: > Adjust diffconfig to run cleanly on Python 3 (Tested with 3.3.2) and > Python 2 (2.7.5) > > Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> > --- > scripts/diffconfig | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/scripts/diffconfig b/scripts/diffconfig > index b91f3e3..dd0e75b 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,13 +79,13 @@ 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" > @@ -94,8 +94,8 @@ def main(): > configa_filename = sys.argv[1] > configb_filename = sys.argv[2] > > - a = readconfig(file(configa_filename)) > - b = readconfig(file(configb_filename)) > + a = readconfig(open(configa_filename)) > + b = readconfig(open(configb_filename)) > > # print items in a but not b (accumulate, sort and print) > old = [] > @@ -121,7 +121,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 = list(b.keys()) > new.sort() > for config in new: > print_config("+", config, None, b[config]) > -- > 1.7.9.5 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kconfig: Make diffconfig work with Python 3 2013-08-09 12:27 [PATCH] kconfig: Make diffconfig work with Python 3 Johannes Thumshirn 2013-08-09 12:30 ` Sam Ravnborg @ 2013-08-28 14:29 ` Tim Bird 2013-08-29 15:10 ` Johannes Thumshirn 1 sibling, 1 reply; 6+ messages in thread From: Tim Bird @ 2013-08-28 14:29 UTC (permalink / raw) To: Johannes Thumshirn; +Cc: Sam Ravnborg, linux-kernel On Fri, Aug 9, 2013 at 5:27 AM, Johannes Thumshirn <johannes.thumshirn@men.de> wrote: > Adjust diffconfig to run cleanly on Python 3 (Tested with 3.3.2) and > Python 2 (2.7.5) > > Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> > --- > scripts/diffconfig | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/scripts/diffconfig b/scripts/diffconfig > index b91f3e3..dd0e75b 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,13 +79,13 @@ 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" > @@ -94,8 +94,8 @@ def main(): > configa_filename = sys.argv[1] > configb_filename = sys.argv[2] > > - a = readconfig(file(configa_filename)) > - b = readconfig(file(configb_filename)) > + a = readconfig(open(configa_filename)) > + b = readconfig(open(configb_filename)) > > # print items in a but not b (accumulate, sort and print) > old = [] > @@ -121,7 +121,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 = list(b.keys()) > new.sort() > for config in new: > print_config("+", config, None, b[config]) > -- > 1.7.9.5 Sorry I missed this earlier. My new e-mail is tim.bird@sonymobile.com, and my old am.sony.com address doesn't work any more. Thanks - this looks great. Acked-by Tim Bird <tim.bird@sonymobile.com> -- Tim Bird Senior Software Engineer, Sony Mobile Architecture Group Chair, CE Workgroup, Linux Foundation ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kconfig: Make diffconfig work with Python 3 2013-08-28 14:29 ` Tim Bird @ 2013-08-29 15:10 ` Johannes Thumshirn 2013-09-03 13:08 ` Michal Marek 0 siblings, 1 reply; 6+ messages in thread From: Johannes Thumshirn @ 2013-08-29 15:10 UTC (permalink / raw) To: Tim Bird Cc: Johannes Thumshirn, Sam Ravnborg, linux-kernel, Michal Marek, linux-kbuild On Wed, Aug 28, 2013 at 07:29:53AM -0700, Tim Bird wrote: > On Fri, Aug 9, 2013 at 5:27 AM, Johannes Thumshirn > <johannes.thumshirn@men.de> wrote: > > Adjust diffconfig to run cleanly on Python 3 (Tested with 3.3.2) and > > Python 2 (2.7.5) > > > > Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> > > --- > > scripts/diffconfig | 26 +++++++++++++------------- > > 1 file changed, 13 insertions(+), 13 deletions(-) > > > > diff --git a/scripts/diffconfig b/scripts/diffconfig > > index b91f3e3..dd0e75b 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,13 +79,13 @@ 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" > > @@ -94,8 +94,8 @@ def main(): > > configa_filename = sys.argv[1] > > configb_filename = sys.argv[2] > > > > - a = readconfig(file(configa_filename)) > > - b = readconfig(file(configb_filename)) > > + a = readconfig(open(configa_filename)) > > + b = readconfig(open(configb_filename)) > > > > # print items in a but not b (accumulate, sort and print) > > old = [] > > @@ -121,7 +121,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 = list(b.keys()) > > new.sort() > > for config in new: > > print_config("+", config, None, b[config]) > > -- > > 1.7.9.5 > > Sorry I missed this earlier. My new e-mail is tim.bird@sonymobile.com, and > my old am.sony.com address doesn't work any more. > > Thanks - this looks great. > > Acked-by Tim Bird <tim.bird@sonymobile.com> > > -- Tim Bird > Senior Software Engineer, Sony Mobile > Architecture Group Chair, CE Workgroup, Linux Foundation Is there any comments from the kbuild maintainers? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kconfig: Make diffconfig work with Python 3 2013-08-29 15:10 ` Johannes Thumshirn @ 2013-09-03 13:08 ` Michal Marek 2013-09-03 13:13 ` Johannes Thumshirn 0 siblings, 1 reply; 6+ messages in thread From: Michal Marek @ 2013-09-03 13:08 UTC (permalink / raw) To: Johannes Thumshirn; +Cc: Tim Bird, Sam Ravnborg, linux-kernel, linux-kbuild On 29.8.2013 17:10, Johannes Thumshirn wrote: > On Wed, Aug 28, 2013 at 07:29:53AM -0700, Tim Bird wrote: >> On Fri, Aug 9, 2013 at 5:27 AM, Johannes Thumshirn >> <johannes.thumshirn@men.de> wrote: >>> Adjust diffconfig to run cleanly on Python 3 (Tested with 3.3.2) and >>> Python 2 (2.7.5) >>> >>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> >>> --- >>> scripts/diffconfig | 26 +++++++++++++------------- >>> 1 file changed, 13 insertions(+), 13 deletions(-) >>> >>> diff --git a/scripts/diffconfig b/scripts/diffconfig >>> index b91f3e3..dd0e75b 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,13 +79,13 @@ 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" >>> @@ -94,8 +94,8 @@ def main(): >>> configa_filename = sys.argv[1] >>> configb_filename = sys.argv[2] >>> >>> - a = readconfig(file(configa_filename)) >>> - b = readconfig(file(configb_filename)) >>> + a = readconfig(open(configa_filename)) >>> + b = readconfig(open(configb_filename)) >>> >>> # print items in a but not b (accumulate, sort and print) >>> old = [] >>> @@ -121,7 +121,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 = list(b.keys()) >>> new.sort() >>> for config in new: >>> print_config("+", config, None, b[config]) >>> -- >>> 1.7.9.5 >> >> Sorry I missed this earlier. My new e-mail is tim.bird@sonymobile.com, and >> my old am.sony.com address doesn't work any more. >> >> Thanks - this looks great. >> >> Acked-by Tim Bird <tim.bird@sonymobile.com> >> >> -- Tim Bird >> Senior Software Engineer, Sony Mobile >> Architecture Group Chair, CE Workgroup, Linux Foundation > > Is there any comments from the kbuild maintainers? I merged a nearly identical patch by Mike Pagano (http://www.spinics.net/lists/linux-kbuild/msg08503.html), seems like you guys had the same idea at the same time. Michal ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] kconfig: Make diffconfig work with Python 3 2013-09-03 13:08 ` Michal Marek @ 2013-09-03 13:13 ` Johannes Thumshirn 0 siblings, 0 replies; 6+ messages in thread From: Johannes Thumshirn @ 2013-09-03 13:13 UTC (permalink / raw) To: Michal Marek Cc: Johannes Thumshirn, Tim Bird, Sam Ravnborg, linux-kernel, linux-kbuild On Tue, Sep 03, 2013 at 03:08:09PM +0200, Michal Marek wrote: > On 29.8.2013 17:10, Johannes Thumshirn wrote: > > On Wed, Aug 28, 2013 at 07:29:53AM -0700, Tim Bird wrote: > >> On Fri, Aug 9, 2013 at 5:27 AM, Johannes Thumshirn > >> <johannes.thumshirn@men.de> wrote: > >>> Adjust diffconfig to run cleanly on Python 3 (Tested with 3.3.2) and > >>> Python 2 (2.7.5) > >>> > >>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> > >>> --- > >>> scripts/diffconfig | 26 +++++++++++++------------- > >>> 1 file changed, 13 insertions(+), 13 deletions(-) > >>> > >>> diff --git a/scripts/diffconfig b/scripts/diffconfig > >>> index b91f3e3..dd0e75b 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,13 +79,13 @@ 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" > >>> @@ -94,8 +94,8 @@ def main(): > >>> configa_filename = sys.argv[1] > >>> configb_filename = sys.argv[2] > >>> > >>> - a = readconfig(file(configa_filename)) > >>> - b = readconfig(file(configb_filename)) > >>> + a = readconfig(open(configa_filename)) > >>> + b = readconfig(open(configb_filename)) > >>> > >>> # print items in a but not b (accumulate, sort and print) > >>> old = [] > >>> @@ -121,7 +121,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 = list(b.keys()) > >>> new.sort() > >>> for config in new: > >>> print_config("+", config, None, b[config]) > >>> -- > >>> 1.7.9.5 > >> > >> Sorry I missed this earlier. My new e-mail is tim.bird@sonymobile.com, and > >> my old am.sony.com address doesn't work any more. > >> > >> Thanks - this looks great. > >> > >> Acked-by Tim Bird <tim.bird@sonymobile.com> > >> > >> -- Tim Bird > >> Senior Software Engineer, Sony Mobile > >> Architecture Group Chair, CE Workgroup, Linux Foundation > > > > Is there any comments from the kbuild maintainers? > > I merged a nearly identical patch by Mike Pagano > (http://www.spinics.net/lists/linux-kbuild/msg08503.html), seems like > you guys had the same idea at the same time. > > Michal lol, ok. At least it doesn't anoy me anymore :-D ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-03 13:13 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-08-09 12:27 [PATCH] kconfig: Make diffconfig work with Python 3 Johannes Thumshirn 2013-08-09 12:30 ` Sam Ravnborg 2013-08-28 14:29 ` Tim Bird 2013-08-29 15:10 ` Johannes Thumshirn 2013-09-03 13:08 ` Michal Marek 2013-09-03 13:13 ` Johannes Thumshirn
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox