[oe-commits] Lucian Musat : oeqa/utils: Fixed a problem with get_bb_var not returning right variable.

git at git.openembedded.org git at git.openembedded.org
Thu May 14 10:44:44 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 1ae7e1cc4a5c7a217dee937c330539e5c8ac794d
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=1ae7e1cc4a5c7a217dee937c330539e5c8ac794d

Author: Lucian Musat <george.l.musat at intel.com>
Date:   Tue May 12 18:00:06 2015 +0300

oeqa/utils: Fixed a problem with get_bb_var not returning right variable.

It searches using regex now and should be more accurate.

Signed-off-by: Lucian Musat <george.l.musat at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/lib/oeqa/utils/commands.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index bc1dbb1..663e4e7 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]



More information about the Openembedded-commits mailing list