aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-11-17 14:44:40 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-11-19 15:59:36 +0100
commit823a02185ed109054c6c1ae366221aaed0353f24 (patch)
tree75ad908cdffc5e486ca615e393113df2904418d7 /lib/bb/fetch/__init__.py
parentb8bb4433de7a981c6826173e926ca34705c4ac70 (diff)
downloadbitbake-823a02185ed109054c6c1ae366221aaed0353f24.tar.gz
fetch: add common helper _strip_leading_slashes()
Several fetcher need a way to strip leading slashes off a local path. This helper-function consolidates all such occurances. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'lib/bb/fetch/__init__.py')
-rw-r--r--lib/bb/fetch/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py
index 0d0fa3596..da53ad6c4 100644
--- a/lib/bb/fetch/__init__.py
+++ b/lib/bb/fetch/__init__.py
@@ -545,6 +545,13 @@ class Fetch(object):
and duplicate code execution)
"""
return url
+ def _strip_leading_slashes(self, relpath):
+ """
+ Remove leading slash as os.path.join can't cope
+ """
+ while os.path.isabs(relpath):
+ relpath = relpath[1:]
+ return relpath
def setUrls(self, urls):
self.__urls = urls