summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 5015779f8d..2469bd7ee2 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -394,3 +394,14 @@ def prunedir(topdir):
394 os.rmdir(os.path.join(root, name)) 394 os.rmdir(os.path.join(root, name))
395 os.rmdir(topdir) 395 os.rmdir(topdir)
396 396
397#
398# Could also use return re.compile("(%s)" % "|".join(map(re.escape, suffixes))).sub(lambda mo: "", var)
399# but thats possibly insane and suffixes is probably going to be small
400#
401def prune_suffix(var, suffixes, d):
402 # See if var ends with any of the suffixes listed and
403 # remove it if found
404 for suffix in suffixes:
405 if var.endswith(suffix):
406 return var.replace(suffix, "")
407 return var