aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/commands.py
diff options
context:
space:
mode:
authorLucian Musat <george.l.musat@intel.com>2015-05-12 18:00:06 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-14 11:44:00 +0100
commit3e7dde7d16ce46c8c4e078c21f8daccb18e4ac0c (patch)
tree4b08b5da5ac41b201279ac8e7b0c45d971798ccc /meta/lib/oeqa/utils/commands.py
parent13fb8554b739914bbb8055091212431c470267dd (diff)
downloadopenembedded-core-contrib-3e7dde7d16ce46c8c4e078c21f8daccb18e4ac0c.tar.gz
oeqa/utils: Fixed a problem with get_bb_var not returning right variable.
It searches using regex now and should be more accurate. (From OE-Core rev: 1ae7e1cc4a5c7a217dee937c330539e5c8ac794d) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/commands.py')
-rw-r--r--meta/lib/oeqa/utils/commands.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index bc1dbb1a5f..663e4e7f41 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -16,6 +16,7 @@ import threading
import logging
from oeqa.utils import CommandError
from oeqa.utils import ftools
+import re
class Command(object):
def __init__(self, command, bg=False, timeout=None, data=None, **options):
@@ -139,11 +140,11 @@ def get_bb_var(var, target=None, postconfig=None):
bbenv = get_bb_env(target, postconfig=postconfig)
lastline = None
for line in bbenv.splitlines():
- if line.startswith(var + "=") or line.startswith("export " + var + "="):
+ if re.search("^(export )?%s=" % var, line):
val = line.split('=')[1]
val = val.strip('\"')
break
- elif line.startswith("unset " + var):
+ elif re.match("unset %s$" % var, line):
# Handle [unexport] variables
if lastline.startswith('# "'):
val = lastline.split('\"')[1]