diff options
author | Andre Rosa <andre.rosa@lge.com> | 2019-04-06 01:29:37 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-07 23:39:46 +0100 |
commit | 57e765e38c6382a9b36d5ee2a6f3fa96ac905b82 (patch) | |
tree | a07108f0eaa39cd49864dbbe844837783e8fae93 /lib/bb/utils.py | |
parent | 30fe86d22c239afa75168cc5eb262b880886ef8a (diff) | |
download | bitbake-57e765e38c6382a9b36d5ee2a6f3fa96ac905b82.tar.gz |
utils: Make prune_suffix prune a suffix
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@lge.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/utils.py')
-rw-r--r-- | lib/bb/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py index b652a6838..d186b1fa2 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): |