From: Michael Tremer Date: Fri, 25 Feb 2011 23:58:13 +0000 (+0100) Subject: Remove badly download package database from cache. X-Git-Tag: 0.9.3~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34102d90679a225baae341b2ae23d2926aee4465;p=pakfire.git Remove badly download package database from cache. --- 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.