diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-24 19:38:02 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:17 -0800 |
commit | 5959b5962b87ae2d5bfa54d0932b54f42b5e24d5 (patch) | |
tree | b2025f84697676e87373c4a4d98c32f1241c6209 | |
parent | 7683e54de6b0c837b043edbc1bcfb3f69cd4aeeb (diff) |
Add package.state.
-rw-r--r-- | MobileCydia.mm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 2d5b831..249f6f0 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -2366,6 +2366,7 @@ struct PackageNameOrdering : @"size", @"source", @"sponsor", + @"state", @"support", @"tags", @"warnings", @@ -2916,6 +2917,33 @@ struct PackageNameOrdering : return files; } +- (NSString *) state { +@synchronized (database_) { + if ([database_ era] != era_ || file_.end()) + return nil; + + switch (iterator_->CurrentState) { + case pkgCache::State::NotInstalled: + return @"NotInstalled"; + case pkgCache::State::UnPacked: + return @"UnPacked"; + case pkgCache::State::HalfConfigured: + return @"HalfConfigured"; + case pkgCache::State::HalfInstalled: + return @"HalfInstalled"; + case pkgCache::State::ConfigFiles: + return @"ConfigFiles"; + case pkgCache::State::Installed: + return @"Installed"; + case pkgCache::State::TriggersAwaited: + return @"TriggersAwaited"; + case pkgCache::State::TriggersPending: + return @"TriggersPending"; + } + + return (NSString *) [NSNull null]; +} } + - (NSArray *) warnings { NSMutableArray *warnings([NSMutableArray arrayWithCapacity:4]); const char *name(iterator_.Name()); |