mirror of
https://git.yoctoproject.org/poky
synced 2026-06-07 03:04:04 +00:00
oeqa.utils.commands: use get_bb_vars() in get_bb_var()
Get rid of duplicate code. (From OE-Core rev: cdd6b7386afd460337705d8117a4328d4993ecef) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.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
c9639e6523
commit
cf4c8980d7
@@ -172,24 +172,14 @@ def get_bb_vars(variables=None, target=None, postconfig=None):
|
||||
if not variables:
|
||||
break
|
||||
lastline = line
|
||||
if variables:
|
||||
# Fill in missing values
|
||||
for var in variables:
|
||||
values[var] = None
|
||||
return values
|
||||
|
||||
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 re.search("^(export )?%s=" % var, line):
|
||||
val = line.split('=', 1)[1]
|
||||
val = val.strip('\"')
|
||||
break
|
||||
elif re.match("unset %s$" % var, line):
|
||||
# Handle [unexport] variables
|
||||
if lastline.startswith('# "'):
|
||||
val = lastline.split('\"')[1]
|
||||
break
|
||||
lastline = line
|
||||
return val
|
||||
return get_bb_vars([var], target, postconfig)[var]
|
||||
|
||||
def get_test_layer():
|
||||
layers = get_bb_var("BBLAYERS").split()
|
||||
|
||||
Reference in New Issue
Block a user