From 20565a96934a0de2ede7ca419020c0c29725aaea Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Wed, 14 Jun 2017 20:30:22 +0100 Subject: bitbake: 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. (Bitbake rev: 022adb30dbb0df764c9fb515918cb9a88e4f8d6f) Signed-off-by: Joshua Lock Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bitbake/lib/bb/fetch2') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 1f63a045c1..ec65216fef 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/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") -- cgit v1.2.3-54-g00ecf