diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-03-03 00:15:12 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2008-03-03 00:15:12 +0000 |
commit | dc088e6392ddb5e48e8b35423ca5242d03ecfe91 (patch) | |
tree | e7db8f2b743d17d88d350569839325b1abd5fad3 | |
parent | b88731cdedccd2f1062ca46ab4984dd5dabcc58c (diff) |
Repair corrupted package databases.
-rw-r--r-- | Cydia.mm | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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_); |