From 34102d90679a225baae341b2ae23d2926aee4465 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 26 Feb 2011 00:58:13 +0100 Subject: [PATCH] Remove badly download package database from cache. --- pakfire/index.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pakfire/index.py b/pakfire/index.py index 0d220dd16..f560c63f1 100644 --- a/pakfire/index.py +++ b/pakfire/index.py @@ -305,6 +305,10 @@ class DatabaseIndex(InstalledIndex): if not util.calc_hash1(cache.abspath(filename)) == self.metadata.database_hash1: # XXX an exception is not a very good idea because this file could # be downloaded from another mirror. need a better way to handle this. + + # Remove bad file from cache. + cache.remove(filename) + raise Exception, "Downloaded file did not match the hashsum. Need to re-download it." # (Re-)open the database. -- 2.39.5