summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/local.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/local.py')
-rw-r--r--bitbake/lib/bb/fetch2/local.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch2/local.py b/bitbake/lib/bb/fetch2/local.py
index e7d1c8c58f..7d7668110e 100644
--- a/bitbake/lib/bb/fetch2/local.py
+++ b/bitbake/lib/bb/fetch2/local.py
@@ -41,9 +41,9 @@ class Local(FetchMethod):
41 """ 41 """
42 Return the local filename of a given url assuming a successful fetch. 42 Return the local filename of a given url assuming a successful fetch.
43 """ 43 """
44 return self.localpaths(urldata, d)[-1] 44 return self.localfile_searchpaths(urldata, d)[-1]
45 45
46 def localpaths(self, urldata, d): 46 def localfile_searchpaths(self, urldata, d):
47 """ 47 """
48 Return the local filename of a given url assuming a successful fetch. 48 Return the local filename of a given url assuming a successful fetch.
49 """ 49 """
@@ -51,18 +51,14 @@ class Local(FetchMethod):
51 path = urldata.decodedurl 51 path = urldata.decodedurl
52 newpath = path 52 newpath = path
53 if path[0] == "/": 53 if path[0] == "/":
54 logger.debug2("Using absolute %s" % (path))
54 return [path] 55 return [path]
55 filespath = d.getVar('FILESPATH') 56 filespath = d.getVar('FILESPATH')
56 if filespath: 57 if filespath:
57 logger.debug2("Searching for %s in paths:\n %s" % (path, "\n ".join(filespath.split(":")))) 58 logger.debug2("Searching for %s in paths:\n %s" % (path, "\n ".join(filespath.split(":"))))
58 newpath, hist = bb.utils.which(filespath, path, history=True) 59 newpath, hist = bb.utils.which(filespath, path, history=True)
60 logger.debug2("Using %s for %s" % (newpath, path))
59 searched.extend(hist) 61 searched.extend(hist)
60 if not os.path.exists(newpath):
61 dldirfile = os.path.join(d.getVar("DL_DIR"), path)
62 logger.debug2("Defaulting to %s for %s" % (dldirfile, path))
63 bb.utils.mkdirhier(os.path.dirname(dldirfile))
64 searched.append(dldirfile)
65 return searched
66 return searched 62 return searched
67 63
68 def need_update(self, ud, d): 64 def need_update(self, ud, d):
@@ -78,9 +74,7 @@ class Local(FetchMethod):
78 filespath = d.getVar('FILESPATH') 74 filespath = d.getVar('FILESPATH')
79 if filespath: 75 if filespath:
80 locations = filespath.split(":") 76 locations = filespath.split(":")
81 locations.append(d.getVar("DL_DIR")) 77 msg = "Unable to find file " + urldata.url + " anywhere to download to " + urldata.localpath + ". The paths that were searched were:\n " + "\n ".join(locations)
82
83 msg = "Unable to find file " + urldata.url + " anywhere. The paths that were searched were:\n " + "\n ".join(locations)
84 raise FetchError(msg) 78 raise FetchError(msg)
85 79
86 return True 80 return True