waf: (fixes #2387) Fix check-profile command

This commit is contained in:
Tom Henderson
2016-05-03 18:01:19 -07:00
parent 660bb7b592
commit a0424d7506

14
wscript
View File

@@ -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