diff options
author | Andre Rosa <andre.rosa@lge.com> | 2019-04-06 01:28:25 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-09 13:44:39 +0100 |
commit | 0dd6823875cac63a7119f63851a0dc01ea1f2e80 (patch) | |
tree | 9b0a09a967db751504a6066436c391781fc2a1be /meta | |
parent | 5897756f71dea2406bcfc2e1e659f00dc17bbf00 (diff) | |
download | poky-0dd6823875cac63a7119f63851a0dc01ea1f2e80.tar.gz |
lib/oe/utils: Make prune_suffix prune a suffix
... instead of replacing a substring that could happen more than once and not only when it ends with it. Do the same for the prefix.
See related https://github.com/openembedded/bitbake/pull/24 . There it stops replacing sufixes once first one is matched but not here.
(From OE-Core rev: 610ac84170f8a91cc3321edfc336a9e39f24ebe3)
Signed-off-by: Andre Rosa <andre.rosa@lge.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oe/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index cedd053d36..a4fd79ccb2 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
@@ -78,12 +78,12 @@ def prune_suffix(var, suffixes, d): | |||
78 | # See if var ends with any of the suffixes listed and | 78 | # See if var ends with any of the suffixes listed and |
79 | # remove it if found | 79 | # remove it if found |
80 | for suffix in suffixes: | 80 | for suffix in suffixes: |
81 | if var.endswith(suffix): | 81 | if suffix and var.endswith(suffix): |
82 | var = var.replace(suffix, "") | 82 | var = var[:-len(suffix)] |
83 | 83 | ||
84 | prefix = d.getVar("MLPREFIX") | 84 | prefix = d.getVar("MLPREFIX") |
85 | if prefix and var.startswith(prefix): | 85 | if prefix and var.startswith(prefix): |
86 | var = var.replace(prefix, "") | 86 | var = var[len(prefix):] |
87 | 87 | ||
88 | return var | 88 | return var |
89 | 89 | ||