From: Arnout Vandecappelle Date: Fri, 21 Jul 2017 01:05:12 +0000 (+0200) Subject: genrandconfig: move instantiation of SystemInfo down X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e8c6d52c89a2c1fd7d40f9e9ad4b7689255538d1;p=buildroot.git genrandconfig: move instantiation of SystemInfo down The SystemInfo class is instantiated globally and passed down to all functions, but it is really only used in fixup_config. So instead, instantiate it there. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Thomas Petazzoni --- diff --git a/utils/genrandconfig b/utils/genrandconfig index a9519b5f2f..79916fef2c 100755 --- a/utils/genrandconfig +++ b/utils/genrandconfig @@ -197,7 +197,7 @@ def is_toolchain_usable(outputdir, config): return True -def fixup_config(outputdir, sysinfo): +def fixup_config(outputdir): """Finalize the configuration and reject any problematic combinations This function returns 'True' when the configuration has been @@ -206,6 +206,7 @@ def fixup_config(outputdir, sysinfo): generated). """ + sysinfo = SystemInfo() with open(os.path.join(outputdir, ".config")) as configf: configlines = configf.readlines() @@ -402,7 +403,7 @@ def gen_config(args): if ret != 0: log_write(args.log, "ERROR: cannot generate random configuration") return -1 - if fixup_config(outputdir, args.sysinfo): + if fixup_config(outputdir): break ret = subprocess.call(["make", "O=%s" % outputdir, "-C", srcdir, @@ -436,7 +437,6 @@ if __name__ == '__main__': # Arguments expected by gen_config for which we just set a default here args.log = sys.stdout - args.sysinfo = SystemInfo() # Output directory is already created by autobuild-run so emulate it here idir = "instance-%d" % args.instance