summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cydia.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/Cydia.mm b/Cydia.mm
index 5d737f8..c24ec42 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -1722,7 +1722,14 @@ NSString *Scour(const char *field, const char *begin, const char *end) {
delete resolver_;
delete records_;
cache_.Close();
- _assert(cache_.Open(progress_, true));
+
+ if (!cache_.Open(progress_, true)) {
+ fprintf(stderr, "repairing corrupted database...\n");
+ _error->Discard();
+ [self update];
+ _assert(cache_.Open(progress_, true));
+ }
+
records_ = new pkgRecords(cache_);
resolver_ = new pkgProblemResolver(cache_);
fetcher_ = new pkgAcquire(&status_);