summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/local.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-19 14:32:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-22 12:03:02 +0000
commit9d7f8e2a206f8266fd0766b6161dbd1bf6b787a7 (patch)
tree2002648fd17558c7d895d672aa65fa46f4b82250 /bitbake/lib/bb/fetch2/local.py
parent4acc7322a2ada941b803e1aee23d84351888eef0 (diff)
downloadpoky-9d7f8e2a206f8266fd0766b6161dbd1bf6b787a7.tar.gz
bitbake: fetch2: Stop passing around the pointless url parameter
There is no good reason to keep passing around the url parameter when its contained within urldata (ud). This is left around due to legacy reasons, some functions take it, some don't and its time to cleanup. This is fetcher internal API, there are a tiny number of external users of the internal API (buildhistory and distrodata) which can be fixed up after this change. (Bitbake rev: 6a48474de9505a3700863f31839a7c53c5e18a8d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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