From a0b774e43ff5d952647fdcf412c9639d4e484ce1 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Fri, 13 Mar 2015 18:25:33 +0000 Subject: 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 Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/lib/oeqa/utils/commands.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'meta/lib/oeqa/utils/commands.py') 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(): -- cgit 1.2.3-korg