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, 8 insertions, 8 deletions
diff --git a/bitbake/lib/bb/fetch2/local.py b/bitbake/lib/bb/fetch2/local.py
index 58bbe20327..5c4e42a942 100644
--- a/bitbake/lib/bb/fetch2/local.py
+++ b/bitbake/lib/bb/fetch2/local.py
@@ -34,7 +34,7 @@ from bb.fetch2 import FetchMethod, FetchError
34from bb.fetch2 import logger 34from bb.fetch2 import logger
35 35
36class Local(FetchMethod): 36class Local(FetchMethod):
37 def supports(self, url, urldata, d): 37 def supports(self, urldata, d):
38 """ 38 """
39 Check to see if a given url represents a local fetch. 39 Check to see if a given url represents a local fetch.
40 """ 40 """
@@ -47,7 +47,7 @@ class Local(FetchMethod):
47 ud.basepath = ud.decodedurl 47 ud.basepath = ud.decodedurl
48 return 48 return
49 49
50 def localpath(self, url, urldata, d): 50 def localpath(self, urldata, d):
51 """ 51 """
52 Return the local filename of a given url assuming a successful fetch. 52 Return the local filename of a given url assuming a successful fetch.
53 """ 53 """
@@ -75,14 +75,14 @@ class Local(FetchMethod):
75 return dldirfile 75 return dldirfile
76 return newpath 76 return newpath
77 77
78 def need_update(self, url, ud, d): 78 def need_update(self, ud, d):
79 if url.find("*") != -1: 79 if ud.url.find("*") != -1:
80 return False 80 return False
81 if os.path.exists(ud.localpath): 81 if os.path.exists(ud.localpath):
82 return False 82 return False
83 return True 83 return True
84 84
85 def download(self, url, urldata, d): 85 def download(self, urldata, d):
86 """Fetch urls (no-op for Local method)""" 86 """Fetch urls (no-op for Local method)"""
87 # no need to fetch local files, we'll deal with them in place. 87 # no need to fetch local files, we'll deal with them in place.
88 if self.supports_checksum(urldata) and not os.path.exists(urldata.localpath): 88 if self.supports_checksum(urldata) and not os.path.exists(urldata.localpath):
@@ -95,17 +95,17 @@ class Local(FetchMethod):
95 locations.append(filesdir) 95 locations.append(filesdir)
96 locations.append(d.getVar("DL_DIR", True)) 96 locations.append(d.getVar("DL_DIR", True))
97 97
98 msg = "Unable to find file " + url + " anywhere. The paths that were searched were:\n " + "\n ".join(locations) 98 msg = "Unable to find file " + urldata.url + " anywhere. The paths that were searched were:\n " + "\n ".join(locations)
99 raise FetchError(msg) 99 raise FetchError(msg)
100 100
101 return True 101 return True
102 102
103 def checkstatus(self, url, urldata, d): 103 def checkstatus(self, urldata, d):
104 """ 104 """
105 Check the status of the url 105 Check the status of the url
106 """ 106 """
107 if urldata.localpath.find("*") != -1: 107 if urldata.localpath.find("*") != -1:
108 logger.info("URL %s looks like a glob and was therefore not checked.", url) 108 logger.info("URL %s looks like a glob and was therefore not checked.", urldata.url)
109 return True 109 return True
110 if os.path.exists(urldata.localpath): 110 if os.path.exists(urldata.localpath):
111 return True 111 return True