diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2010-11-17 14:44:40 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:41 +0000 |
commit | 87b6f7d27ace9d6465414c28bbba003f368a49dd (patch) | |
tree | 8c53d7327b7dc8eec439cae5c69de5b36ba42ed3 /bitbake/lib/bb/fetch/__init__.py | |
parent | d0d67a9fe279d26423494946666a5ca0acc5d66f (diff) | |
download | ast2050-yocto-poky-87b6f7d27ace9d6465414c28bbba003f368a49dd.zip ast2050-yocto-poky-87b6f7d27ace9d6465414c28bbba003f368a49dd.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.
(Bitbake rev: 823a02185ed109054c6c1ae366221aaed0353f24)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index faf7fc4..c9c8bdb 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py @@ -607,6 +607,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 |