summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/utils.py
diff options
context:
space:
mode:
authorAndre Rosa <andre.rosa@lge.com>2019-04-06 01:28:25 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-09 12:44:39 (GMT)
commit0dd6823875cac63a7119f63851a0dc01ea1f2e80 (patch)
tree9b0a09a967db751504a6066436c391781fc2a1be /meta/lib/oe/utils.py
parent5897756f71dea2406bcfc2e1e659f00dc17bbf00 (diff)
downloadpoky-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/lib/oe/utils.py')
-rw-r--r--meta/lib/oe/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index cedd053..a4fd79c 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