]> git.ipfire.org Git - pakfire.git/commitdiff
Remove badly download package database from cache.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Feb 2011 23:58:13 +0000 (00:58 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Feb 2011 23:58:13 +0000 (00:58 +0100)
pakfire/index.py

index 0d220dd16f83a51b14f28f707021b40942d58a6c..f560c63f1b849d051ab3c1e80cd1beaa79a88706 100644 (file)
@@ -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.