summaryrefslogtreecommitdiffstats
path: root/meta
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:27:47 +0000
commita0b774e43ff5d952647fdcf412c9639d4e484ce1 (patch)
tree4eb6ecd15ac1bc69e0e2714e6c3778903efdfd7e /meta
parent3c4c63d0ff2fa1ce1357b41e004defd7416306b5 (diff)
downloadpoky-a0b774e43ff5d952647fdcf412c9639d4e484ce1.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. (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>
Diffstat (limited to 'meta')
-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):
137def get_bb_var(var, target=None, postconfig=None): 137def get_bb_var(var, target=None, postconfig=None):
138 val = None 138 val = None
139 bbenv = get_bb_env(target, postconfig=postconfig) 139 bbenv = get_bb_env(target, postconfig=postconfig)
140 lastline = None
140 for line in bbenv.splitlines(): 141 for line in bbenv.splitlines():
141 if line.startswith(var + "=") or line.startswith("export " + var + "="): 142 if line.startswith(var + "=") or line.startswith("export " + var + "="):
142 val = line.split('=')[1] 143 val = line.split('=')[1]
143 val = val.strip('\"') 144 val = val.strip('\"')
144 break 145 break
146 elif line.startswith("unset " + var):
147 # Handle [unexport] variables
148 if lastline.startswith('# "'):
149 val = lastline.split('\"')[1]
150 break
151 lastline = line
145 return val 152 return val
146 153
147def get_test_layer(): 154def get_test_layer():