@@ -716,13 +716,10 @@ def verify_donestamp(ud, d, origud=None):
p.dump(checksums)
return True
except ChecksumError as e:
- # Checksums failed to verify, trigger re-download and remove the
- # incorrect stamp file.
- logger.warning("Checksum mismatch for local file %s\n"
- "Cleaning and trying again." % ud.localpath)
- if os.path.exists(ud.localpath):
- rename_bad_checksum(ud, e.checksum)
- bb.utils.remove(ud.donestamp)
+ # If there is a checksum mismatch, it is likely because the file
+ # is being tainted or some corruption is occurring when downloading.
+ # Download cache should be cleaned up before trying again.
+ bb.fatal("Checksum mismatch for local file %s\n" % ud.localpath)
return False
@@ -899,10 +899,8 @@ class FetcherNoNetworkTest(FetcherTest):
self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/test-file.tar.gz"], self.d)
- with self.assertRaises(bb.fetch2.NetworkAccess):
+ with self.assertRaises(bb.BBHandledException):
fetcher.download()
- # the existing file should not exist or should have be moved to "bad-checksum"
- self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
def test_nochecksums_missing(self):
self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))