summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2017-06-14 20:30:22 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-16 00:20:54 +0100
commit022adb30dbb0df764c9fb515918cb9a88e4f8d6f (patch)
treed48cd4092cc57e65f1fb984c05e88e701a4229df
parent03ba8db0595723286ad462fa197f862e1efdf0de (diff)
downloadbitbake-contrib-022adb30dbb0df764c9fb515918cb9a88e4f8d6f.tar.gz
fetch: fix handling of files with incorrect checksums from a premirror
Ensure that when an item fetched from a premirror has an invalid checksum the fetcher falls back to the usual logic of trying the upstream and any configured mirrors. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 1f63a045c..ec65216fe 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1621,6 +1621,15 @@ class Fetch(object):
logger.debug(1, "Trying PREMIRRORS")
mirrors = mirror_from_string(self.d.getVar('PREMIRRORS'))
localpath = try_mirrors(self, self.d, ud, mirrors, False)
+ if localpath:
+ try:
+ # early checksum verification so that if the checksum of the premirror
+ # contents mismatch the fetcher can still try upstream and mirrors
+ update_stamp(ud, self.d)
+ except ChecksumError as e:
+ logger.warning("Checksum failure encountered with premirror download of %s - will attempt other sources." % u)
+ logger.debug(1, str(e))
+ localpath = ""
if premirroronly:
self.d.setVar("BB_NO_NETWORK", "1")