mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
13fb8554b7
commit
3e7dde7d16
@@ -16,6 +16,7 @@ import threading
|
|||||||
import logging
|
import logging
|
||||||
from oeqa.utils import CommandError
|
from oeqa.utils import CommandError
|
||||||
from oeqa.utils import ftools
|
from oeqa.utils import ftools
|
||||||
|
import re
|
||||||
|
|
||||||
class Command(object):
|
class Command(object):
|
||||||
def __init__(self, command, bg=False, timeout=None, data=None, **options):
|
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)
|
bbenv = get_bb_env(target, postconfig=postconfig)
|
||||||
lastline = None
|
lastline = None
|
||||||
for line in bbenv.splitlines():
|
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 = line.split('=')[1]
|
||||||
val = val.strip('\"')
|
val = val.strip('\"')
|
||||||
break
|
break
|
||||||
elif line.startswith("unset " + var):
|
elif re.match("unset %s$" % var, line):
|
||||||
# Handle [unexport] variables
|
# Handle [unexport] variables
|
||||||
if lastline.startswith('# "'):
|
if lastline.startswith('# "'):
|
||||||
val = lastline.split('\"')[1]
|
val = lastline.split('\"')[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user