]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch2: Fix unpack for absolute file urls
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 26 Feb 2016 17:36:49 +0000 (17:36 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Mar 2016 22:40:27 +0000 (22:40 +0000)
The previous commit breaks absolute pathnames in file:// urls, this
fixes it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/__init__.py

index 9ebdcdb91d50c6cdd28ca4daa6255bbf58ba2f1c..e8d3af72e89b11b11c16e800a59758c9d8d283df 100644 (file)
@@ -1394,7 +1394,10 @@ class FetchMethod(object):
                 destdir = '.'
                 # For file:// entries all intermediate dirs in path must be created at destination
                 if urldata.type == "file":
-                    urlpath = urldata.path.rstrip('/') # Trailing '/' does a copying to wrong place
+                    # Trailing '/' does a copying to wrong place
+                    urlpath = urldata.path.rstrip('/')
+                    # Want files places relative to cwd so no leading '/'
+                    urlpath = urlpath.lstrip('/')
                     if urlpath.find("/") != -1:
                         destdir = urlpath.rsplit("/", 1)[0] + '/'
                         bb.utils.mkdirhier("%s/%s" % (unpackdir, destdir))