summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-03-03 00:15:12 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2008-03-03 00:15:12 +0000
commitdc088e6392ddb5e48e8b35423ca5242d03ecfe91 (patch)
treee7db8f2b743d17d88d350569839325b1abd5fad3
parentb88731cdedccd2f1062ca46ab4984dd5dabcc58c (diff)
Repair corrupted package databases.
-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_);