aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-03-13 18:25:33 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-20 11:03:13 +0000
commit48b58466bba084fd3439706d47e0cfbb7e951ee4 (patch)
tree7587b54d0ebc7b270e892284eb232f2322b0e172
parent6bcc652f5168d87e76b059f9e9825b8bcf049b90 (diff)
downloadopenembedded-core-contrib-48b58466bba084fd3439706d47e0cfbb7e951ee4.tar.gz
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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/lib/oeqa/utils/commands.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 5b601d9806..e8a467f4cd 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -137,11 +137,18 @@ def get_bb_env(target=None, postconfig=None):
def get_bb_var(var, target=None, postconfig=None):
val = None
bbenv = get_bb_env(target, postconfig=postconfig)
+ lastline = None
for line in bbenv.splitlines():
if line.startswith(var + "=") or line.startswith("export " + var + "="):
val = line.split('=')[1]
val = val.strip('\"')
break
+ elif line.startswith("unset " + var):
+ # Handle [unexport] variables
+ if lastline.startswith('# "'):
+ val = lastline.split('\"')[1]
+ break
+ lastline = line
return val
def get_test_layer():