From: Andre Rosa Date: Sat, 6 Apr 2019 01:29:37 +0000 (+0000) Subject: bitbake: utils: Make prune_suffix prune a suffix X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=27cbc8c5f07c46b462135b9542cdf46ab667bf36;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: 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. (Bitbake rev: 57e765e38c6382a9b36d5ee2a6f3fa96ac905b82) Signed-off-by: Andre Rosa Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index b652a6838a2..d186b1fa272 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/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):