summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 3af56e5d0a..21abb13b19 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -55,7 +55,10 @@ class MalformedUrl(BBFetchException):
55class FetchError(BBFetchException): 55class FetchError(BBFetchException):
56 """General fetcher exception when something happens incorrectly""" 56 """General fetcher exception when something happens incorrectly"""
57 def __init__(self, message, url = None): 57 def __init__(self, message, url = None):
58 msg = "Fetcher failure for URL: '%s'. %s" % (url, message) 58 if url:
59 msg = "Fetcher failure for URL: '%s'. %s" % (url, message)
60 else:
61 msg = "Fetcher failure: %s" % message
59 self.url = url 62 self.url = url
60 BBFetchException.__init__(self, msg) 63 BBFetchException.__init__(self, msg)
61 self.args = (message, url) 64 self.args = (message, url)
@@ -302,10 +305,10 @@ def verify_checksum(u, ud, d):
302 # it does not match. 305 # it does not match.
303 msg = "" 306 msg = ""
304 if md5mismatch and ud.md5_expected: 307 if md5mismatch and ud.md5_expected:
305 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected (from URL: '%s')" % (ud.localpath, 'md5', md5data, ud.md5_expected, u) 308 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'md5', md5data, ud.md5_expected)
306 309
307 if sha256mismatch and ud.sha256_expected: 310 if sha256mismatch and ud.sha256_expected:
308 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected (from URL: '%s')" % (ud.localpath, 'sha256', sha256data, ud.sha256_expected, u) 311 msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'sha256', sha256data, ud.sha256_expected)
309 312
310 if len(msg): 313 if len(msg):
311 raise FetchError('Checksum mismatch!%s' % msg, u) 314 raise FetchError('Checksum mismatch!%s' % msg, u)
@@ -983,7 +986,7 @@ class Fetch(object):
983 localpath = try_mirrors (self.d, ud, mirrors) 986 localpath = try_mirrors (self.d, ud, mirrors)
984 987
985 if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1): 988 if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1):
986 raise FetchError("Unable to fetch URL %s from any source." % u, u) 989 raise FetchError("Unable to fetch URL from any source.", u)
987 990
988 update_stamp(u, ud, self.d) 991 update_stamp(u, ud, self.d)
989 992