From: Richard Purdie Date: Fri, 26 Feb 2016 17:36:49 +0000 (+0000) Subject: fetch2: Fix unpack for absolute file urls X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8113a1800687a37a26ac28deafdbafd74cc138e;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git fetch2: Fix unpack for absolute file urls The previous commit breaks absolute pathnames in file:// urls, this fixes it. Signed-off-by: Richard Purdie --- diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 9ebdcdb91d5..e8d3af72e89 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -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))