diff options
| author | Ross Burton <ross@burtonini.com> | 2022-03-31 19:29:07 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-01 23:11:37 +0100 |
| commit | 4e5f84902e52d477e46eb83978f23416f09bbc6a (patch) | |
| tree | 86a9d750ffc27bb041ed05004cbb212c537cb4aa /meta/lib | |
| parent | 668753b8ed620785a7bfd999d78b5c09c1186c73 (diff) | |
| download | poky-4e5f84902e52d477e46eb83978f23416f09bbc6a.tar.gz | |
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>
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oeqa/core/decorator/data.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py index bc4939e87c..12197be246 100644 --- a/meta/lib/oeqa/core/decorator/data.py +++ b/meta/lib/oeqa/core/decorator/data.py | |||
| @@ -13,8 +13,8 @@ def has_feature(td, feature): | |||
| 13 | Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES. | 13 | Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES. |
| 14 | """ | 14 | """ |
| 15 | 15 | ||
| 16 | if (feature in td.get('DISTRO_FEATURES', '') or | 16 | if (feature in td.get('DISTRO_FEATURES', '').split() or |
| 17 | feature in td.get('IMAGE_FEATURES', '')): | 17 | feature in td.get('IMAGE_FEATURES', '').split()): |
| 18 | return True | 18 | return True |
| 19 | return False | 19 | return False |
| 20 | 20 | ||
| @@ -23,7 +23,7 @@ def has_machine(td, machine): | |||
| 23 | Checks for MACHINE. | 23 | Checks for MACHINE. |
| 24 | """ | 24 | """ |
| 25 | 25 | ||
| 26 | if (machine in td.get('MACHINE', '')): | 26 | if (machine == td.get('MACHINE', '')): |
| 27 | return True | 27 | return True |
| 28 | return False | 28 | return False |
| 29 | 29 | ||
