summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-05-17 00:49:56 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-05-17 00:59:11 -0700
commit3f88f20507c0870b890db839c17186d6928fae29 (patch)
tree0ba2c541d517441faab31388b12d366314ac2e20 /MobileCydia.mm
parentb129e6d9d0d67a3854b263ec4bf4f497e5d9f9ee (diff)
Rely on GetIndexes instead of ComputeIndexTargets.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm16
1 files changed, 9 insertions, 7 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index e9dab51..900e76e 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -1498,18 +1498,20 @@ static void PackageImport(const void *key, const void *value, void *context) {
debReleaseIndex *dindex(dynamic_cast<debReleaseIndex *>(index));
if (dindex != NULL) {
std::string file(dindex->MetaIndexURI(""));
- files_.insert(file + "Release.gpg");
- files_.insert(file + "Release");
base_.set(pool, file);
- std::vector<IndexTarget *> *targets(dindex->ComputeIndexTargets());
- for (std::vector<IndexTarget *>::const_iterator target(targets->begin()); target != targets->end(); ++target) {
- std::string file((*target)->URI);
+ pkgAcquire acquire;
+ dindex->GetIndexes(&acquire, true);
+ for (pkgAcquire::ItemIterator item(acquire.ItemsBegin()); item != acquire.ItemsEnd(); item++) {
+ std::string file((*item)->DescURI());
+ files_.insert(file);
+ if (file.length() < sizeof("Packages.bz2") || file.substr(file.length() - sizeof("Packages.bz2")) != "/Packages.bz2")
+ continue;
+ file = file.substr(0, file.length() - 4);
files_.insert(file);
files_.insert(file + ".gz");
- files_.insert(file + ".bz2");
files_.insert(file + "Index");
- } delete targets;
+ }
FileFd fd;
if (!fd.Open(dindex->MetaIndexFile("Release"), FileFd::ReadOnly))