diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-25 12:58:57 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-28 08:36:56 +0100 |
commit | 24a4fa5bad7f9b59347035a99087e5503a9388b4 (patch) | |
tree | 0d75324b7c623b0016e5fadff19ba471c157340b /bitbake | |
parent | 48abe482dd1a743a87e69769da3f102caa115d5b (diff) | |
download | poky-24a4fa5bad7f9b59347035a99087e5503a9388b4.tar.gz |
bitbake: taskdata: Improve handling of regex in ASSUME_PROVIDED
ASSUME_PROVIDED can take regexs however the current way of handling
this in code is suboptimal. It means that you can add something like:
DEPENDS += "texinfo-nativejunk-that-does-not-exist"
and if texinfo-native is in ASSUME_PROVIDED, no error will occur.
Update the code to only treat something as a regex if a start or end
anchor character is present (which wouldn't be valid in a recipe name).
[YOCTO #13893]
(Bitbake rev: 3d72e23109990970fbb1086923277af752168b4a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/taskdata.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py index d13a124983..ffbaf362e8 100644 --- a/bitbake/lib/bb/taskdata.py +++ b/bitbake/lib/bb/taskdata.py | |||
@@ -21,8 +21,13 @@ def re_match_strings(target, strings): | |||
21 | Whether or not the string 'target' matches | 21 | Whether or not the string 'target' matches |
22 | any one string of the strings which can be regular expression string | 22 | any one string of the strings which can be regular expression string |
23 | """ | 23 | """ |
24 | return any(name == target or re.match(name, target) | 24 | for name in strings: |
25 | for name in strings) | 25 | if name.startswith("^") or name.endswith("$"): |
26 | if re.match(name, target): | ||
27 | return True | ||
28 | elif name == target: | ||
29 | return True | ||
30 | return False | ||
26 | 31 | ||
27 | class TaskEntry: | 32 | class TaskEntry: |
28 | def __init__(self): | 33 | def __init__(self): |