[oe-commits] [bitbake] branch master-next updated: Make prune_suffix prune a suffix

git at git.openembedded.org git at git.openembedded.org
Sun Apr 7 22:36:26 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

The following commit(s) were added to refs/heads/master-next by this push:
     new 2ba65f6  Make prune_suffix prune a suffix
2ba65f6 is described below

commit 2ba65f6425cc54a8ca5a65ef538a61ebfb13b2d0
Author: Andre Rosa <andre.rosa at lge.com>
AuthorDate: Sat Apr 6 01:29:37 2019 +0000

    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.
    
    Signed-off-by: Andre Rosa <andre.rosa at lge.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/utils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index b652a68..d186b1f 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):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list