[bitbake-devel] [PATCH] Make prune_suffix prune a suffix
andre.rosa
andre.rosa at lge.com
Sat Apr 6 00:12:23 UTC 2019
From: Andre Rosa <andre.rosa at lge.com>
... instead of replacing a substring that could happen more than once and not only when it ends with it.
Signed-off-by: Andre Rosa <andre.rosa at lge.com>
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index b652a683..d186b1fa 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -722,8 +722,8 @@ def prune_suffix(var, suffixes, d):
# See if var ends with any of the suffixes listed and
# remove it if found
for suffix in suffixes:
- if var.endswith(suffix):
- return var.replace(suffix, "")
+ if suffix and var.endswith(suffix):
+ return var[:-len(suffix)]
return var
def mkdirhier(directory):
--
2.20.1
More information about the bitbake-devel
mailing list