From patchwork Wed Jul 25 21:12:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel] fetch/local: Allow preservation of path components in relative file:// urls Date: Wed, 25 Jul 2012 21:12:30 -0000 From: Richard Purdie X-Patchwork-Id: 33081 Message-Id: <1343250750.29991.3.camel@ted> To: bitbake-devel This enhances the fetcher to allow preservation of the path component in urls like: file://xxx/yyy/somefile.patch. Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/fetch2/local.py b/bitbake/lib/bb/fetch2/local.py index 1f4ec37..bfef079 100644 --- a/bitbake/lib/bb/fetch2/local.py +++ b/bitbake/lib/bb/fetch2/local.py @@ -60,9 +60,10 @@ class Local(FetchMethod): filesdir = data.getVar('FILESDIR', d, True) if filesdir: newpath = os.path.join(filesdir, path) - if not os.path.exists(newpath) and path.find("*") == -1: - dldirfile = os.path.join(data.getVar("DL_DIR", d, True), os.path.basename(path)) - return dldirfile + if not os.path.exists(newpath) and path.find("*") == -1: + dldirfile = os.path.join(d.getVar("DL_DIR", True), path) + bb.utils.mkdirhier(os.path.dirname(dldirfile)) + return dldirfile return newpath def need_update(self, url, ud, d):