From 1e70470545c348c21f521fa6b7b4cf707d989aad Mon Sep 17 00:00:00 2001 From: Arnout Vandecappelle Date: Fri, 21 Jul 2017 03:05:18 +0200 Subject: [PATCH] genrandconfig: fix the case when outputdir is 'output' When outputdir is 'output' (the default), genrandconfig didn't work correctly because it expects the configfile in outputdir, while Buildroot puts it in the buildroot directory. Fix this by explicitly checking if outputdir == buildrootdir/output. Because abspath is used for both paths, string comparison works reliably. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Thomas Petazzoni --- utils/genrandconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/genrandconfig b/utils/genrandconfig index eaca6cff8c..4ff7deb26a 100755 --- a/utils/genrandconfig +++ b/utils/genrandconfig @@ -354,7 +354,10 @@ def gen_config(args): # Write out the configuration file if not os.path.exists(args.outputdir): os.makedirs(args.outputdir) - configfile = os.path.join(args.outputdir, ".config") + if args.outputdir == os.path.abspath(os.path.join(args.buildrootdir, "output")): + configfile = os.path.join(args.buildrootdir, ".config") + else: + configfile = os.path.join(args.outputdir, ".config") with open(configfile, "w+") as configf: configf.writelines(configlines) -- 2.30.2