]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: utils: Make prune_suffix prune a suffix
authorAndre Rosa <andre.rosa@lge.com>
Sat, 6 Apr 2019 01:29:37 +0000 (01:29 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 9 Apr 2019 12:45:15 +0000 (13:45 +0100)
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.

(Bitbake rev: 57e765e38c6382a9b36d5ee2a6f3fa96ac905b82)

Signed-off-by: Andre Rosa <andre.rosa@lge.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/utils.py

index b652a6838a290a48812ac59ef2aafd0abec04203..d186b1fa2725964de4abd07c1f6a2b9ca1154265 100644 (file)
@@ -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):