summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-12-01 18:13:54 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-12-02 00:51:36 -0800
commit029c8b74ccda00c74f8a39bc75f817d4763ae93a (patch)
tree3c25e1cff10c50c991ac82378d51da25af5bc5ec
parent7a11fbb993dd74d270f452507777595753458586 (diff)
Package::id_ needs to be backed by Cytore, not APT.
-rw-r--r--MobileCydia.mm26
1 files changed, 11 insertions, 15 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 20d82bb..55c8bd5 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -2206,7 +2206,6 @@ struct PackageNameOrdering :
_end
_profile(Package$initWithVersion$Cache)
- id_.set(NULL, iterator.Name());
name_.set(NULL, iterator.Display());
latest_.set(NULL, StripVersion_(version_.VerStr()));
@@ -2216,19 +2215,6 @@ struct PackageNameOrdering :
installed_.set(NULL, StripVersion_(current.VerStr()));
_end
- _profile(Package$initWithVersion$Lower)
- // XXX: do not use tolower() as this is not locale-specific? :(
- char *data(id_.data());
- for (size_t i(0), e(id_.size()); i != e; ++i)
- if ((data[i] & 0x20) == 0) {
- id_.copy(pool);
- data = id_.data();
- for (; i != e; ++i)
- data[i] |= 0x20;
- break;
- }
- _end
-
_profile(Package$initWithVersion$Tags)
pkgCache::TagIterator tag(iterator.TagList());
if (!tag.end()) {
@@ -2253,9 +2239,19 @@ struct PackageNameOrdering :
_end
_profile(Package$initWithVersion$Metadata)
- PackageValue *metadata(PackageFind(id_.data(), id_.size()));
+ const char *mixed(iterator.Name());
+ size_t size(strlen(mixed));
+ char lower[size + 1];
+
+ for (size_t i(0); i != size; ++i)
+ lower[i] = mixed[i] | 0x20;
+ lower[size] = '\0';
+
+ PackageValue *metadata(PackageFind(lower, size));
metadata_ = metadata;
+ id_.set(NULL, metadata->name_, size);
+
const char *latest(version_.VerStr());
size_t length(strlen(latest));