From a0424d7506b9893f175eb219097446e4dbe7fa2b Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Tue, 3 May 2016 18:01:19 -0700 Subject: [PATCH] waf: (fixes #2387) Fix check-profile command --- wscript | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index 16820d49f..3123e1672 100644 --- a/wscript +++ b/wscript @@ -749,7 +749,19 @@ def build(bld): env = bld.env if Options.options.check_profile: - print("Build profile: %s" % Options.options.build_profile) + # Parse the waf lockfile generated by latest 'configure' operation + lockfile = os.environ.get('WAFLOCK', '.lock-waf_%s_build' % sys.platform) + profile = "not found" + with open(lockfile, "r") as f: + for line in f: + if line.startswith("options ="): + key, val = line.split('=') + arr = val.split(',') + for x in arr: + optkey,optval = x.split(':') + if (optkey.lstrip() == '\'build_profile\''): + profile = str(optval.lstrip()).replace("'","") + print("Build profile: %s" % profile) raise SystemExit(0) return