oe-selftest: support getting unexported variable values
Allow get_bb_var() to work with unexported variable values such as MACHINE - the workaround is a little crude but should suffice for now. (From OE-Core rev: 48b58466bba084fd3439706d47e0cfbb7e951ee4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
3c4c63d0ff
commit
a0b774e43f
|
@ -137,11 +137,18 @@ def get_bb_env(target=None, postconfig=None):
|
||||||
def get_bb_var(var, target=None, postconfig=None):
|
def get_bb_var(var, target=None, postconfig=None):
|
||||||
val = None
|
val = None
|
||||||
bbenv = get_bb_env(target, postconfig=postconfig)
|
bbenv = get_bb_env(target, postconfig=postconfig)
|
||||||
|
lastline = None
|
||||||
for line in bbenv.splitlines():
|
for line in bbenv.splitlines():
|
||||||
if line.startswith(var + "=") or line.startswith("export " + var + "="):
|
if line.startswith(var + "=") or line.startswith("export " + var + "="):
|
||||||
val = line.split('=')[1]
|
val = line.split('=')[1]
|
||||||
val = val.strip('\"')
|
val = val.strip('\"')
|
||||||
break
|
break
|
||||||
|
elif line.startswith("unset " + var):
|
||||||
|
# Handle [unexport] variables
|
||||||
|
if lastline.startswith('# "'):
|
||||||
|
val = lastline.split('\"')[1]
|
||||||
|
break
|
||||||
|
lastline = line
|
||||||
return val
|
return val
|
||||||
|
|
||||||
def get_test_layer():
|
def get_test_layer():
|
||||||
|
|
Loading…
Reference in New Issue