From: Jay Freeman (saurik) Date: Mon, 3 Mar 2008 00:15:12 +0000 (+0000) Subject: Repair corrupted package databases. X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/3957dd75c5c526907f393b7600f298ce05c8e80a Repair corrupted package databases. --- diff --git a/Cydia.mm b/Cydia.mm index 5d737f83..c24ec421 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_);