]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: fetch/local: Allow preservation of path components in relative file:// urls
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 25 Jul 2012 19:04:45 +0000 (19:04 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Jul 2012 13:55:22 +0000 (14:55 +0100)
This enhances the fetcher to allow preservation of the path component in urls
like: file://xxx/yyy/somefile.patch.

(Bitbake rev: e49a656a499355a5c6e7eb00bf5b8f1795e8dddb)

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

index 1f4ec371a4d39e624617b5c3657b41c4c3b16d9c..bfef0791a5009ad3adb526ff59b0366e087bc38d 100644 (file)
@@ -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):