mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
oeqa/core/decorators/data: improve has_* logic
has_feature() should be splitting the feature string into substrings and then looking for membership instead of looking for simple substrings. has_machine() should be using equality instead of substrings. (From OE-Core rev: a4c63819234e252c58e040af8bbdbfb96b6feccf) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
668753b8ed
commit
4e5f84902e
@@ -13,8 +13,8 @@ def has_feature(td, feature):
|
||||
Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES.
|
||||
"""
|
||||
|
||||
if (feature in td.get('DISTRO_FEATURES', '') or
|
||||
feature in td.get('IMAGE_FEATURES', '')):
|
||||
if (feature in td.get('DISTRO_FEATURES', '').split() or
|
||||
feature in td.get('IMAGE_FEATURES', '').split()):
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -23,7 +23,7 @@ def has_machine(td, machine):
|
||||
Checks for MACHINE.
|
||||
"""
|
||||
|
||||
if (machine in td.get('MACHINE', '')):
|
||||
if (machine == td.get('MACHINE', '')):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user