diff options
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r-- | bitbake/lib/bb/fetch/__init__.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index 41eebb29b5..c697f4744f 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py | |||
@@ -162,6 +162,22 @@ def go(d): | |||
162 | Fetch.write_md5sum(u, ud, d) | 162 | Fetch.write_md5sum(u, ud, d) |
163 | bb.utils.unlockfile(lf) | 163 | bb.utils.unlockfile(lf) |
164 | 164 | ||
165 | |||
166 | def checkstatus(d): | ||
167 | """ | ||
168 | Check all urls exist upstream | ||
169 | init must have previously been called | ||
170 | """ | ||
171 | urldata = init([], d, True) | ||
172 | |||
173 | for u in urldata: | ||
174 | ud = urldata[u] | ||
175 | m = ud.method | ||
176 | bb.msg.note(1, bb.msg.domain.Fetcher, "Testing URL %s" % u) | ||
177 | ret = m.checkstatus(u, ud, d) | ||
178 | if not ret: | ||
179 | bb.msg.fatal(bb.msg.domain.Fetcher, "URL %s doesn't work" % u) | ||
180 | |||
165 | def localpaths(d): | 181 | def localpaths(d): |
166 | """ | 182 | """ |
167 | Return a list of the local filenames, assuming successful fetch | 183 | Return a list of the local filenames, assuming successful fetch |
@@ -364,6 +380,14 @@ class Fetch(object): | |||
364 | """ | 380 | """ |
365 | raise NoMethodError("Missing implementation for url") | 381 | raise NoMethodError("Missing implementation for url") |
366 | 382 | ||
383 | def checkstatus(self, url, urldata, d): | ||
384 | """ | ||
385 | Check the status of a URL | ||
386 | Assumes localpath was called first | ||
387 | """ | ||
388 | bb.msg.note(1, bb.msg.domain.Fetcher, "URL %s could not be checked for status since no method exists." % url) | ||
389 | return True | ||
390 | |||
367 | def getSRCDate(urldata, d): | 391 | def getSRCDate(urldata, d): |
368 | """ | 392 | """ |
369 | Return the SRC Date for the component | 393 | Return the SRC Date for the component |