Skip to contentSkip to conversation

fetch/local: Allow preservation of path components in relative file:// urls

PATCH New Richard Purdie 1 participant 1 message Jul 25, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch/local: Allow preservation of path components in relative file:// urls

This enhances the fetcher to allow preservation of the path component in urls
like: file://xxx/yyy/somefile.patch.

---

bitbake/lib/bb/fetch2/local.py +4 -3
index 1f4ec37..bfef079 100644
@@ -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):