summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/fetch/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 41eebb29b..c697f4744 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -162,6 +162,22 @@ def go(d):
Fetch.write_md5sum(u, ud, d)
bb.utils.unlockfile(lf)
+
+def checkstatus(d):
+ """
+ Check all urls exist upstream
+ init must have previously been called
+ """
+ urldata = init([], d, True)
+
+ for u in urldata:
+ ud = urldata[u]
+ m = ud.method
+ bb.msg.note(1, bb.msg.domain.Fetcher, "Testing URL %s" % u)
+ ret = m.checkstatus(u, ud, d)
+ if not ret:
+ bb.msg.fatal(bb.msg.domain.Fetcher, "URL %s doesn't work" % u)
+
def localpaths(d):
"""
Return a list of the local filenames, assuming successful fetch
@@ -364,6 +380,14 @@ class Fetch(object):
"""
raise NoMethodError("Missing implementation for url")
+ def checkstatus(self, url, urldata, d):
+ """
+ Check the status of a URL
+ Assumes localpath was called first
+ """
+ bb.msg.note(1, bb.msg.domain.Fetcher, "URL %s could not be checked for status since no method exists." % url)
+ return True
+
def getSRCDate(urldata, d):
"""
Return the SRC Date for the component