From a4a93d599b06516cc112ca683409db0dc619600d Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 30 Oct 2014 11:19:43 -0700 Subject: [PATCH] The Cytore metadata should have been in ~/Library. --- MobileCydia.mm | 3 ++- postinst.mm | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index c57910f9..ab00331c 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -10472,7 +10472,8 @@ int main(int argc, char *argv[]) { _root(CydiaWriteSources()); _trace(); - MetaFile_.Open([Cache("metadata.cb0") UTF8String]); + mkdir("/var/mobile/Library/Cydia", 0755); + MetaFile_.Open("/var/mobile/Library/Cydia/metadata.cb0"); _trace(); if (Packages_ != nil) { diff --git a/postinst.mm b/postinst.mm index c6dd9650..55739e0d 100644 --- a/postinst.mm +++ b/postinst.mm @@ -180,11 +180,20 @@ int main(int argc, const char *argv[]) { system("chown -R 501.501 " NewCache_ "/lists"); } - if (access(NewCache_ "/metadata.cb0", F_OK) != 0 && errno == ENOENT) - if (access("/var/lib/cydia/metadata.cb0", F_OK) == 0) { - system("mv /var/lib/cydia/metadata.cb0 " NewCache_); - chown(NewCache_ "/metadata.cb0", 501, 501); - } + #define OldLibrary_ "/var/lib/cydia" + + #define NewLibrary_ "/var/mobile/Library/Cydia" + system("cd /; su -c 'mkdir -p " NewLibrary_ "' mobile"); + + #define Cytore_ "/metadata.cb0" + + if (access(NewLibrary_ Cytore_, F_OK) != 0 && errno == ENOENT) { + if (access(NewCache_ Cytore_, F_OK) == 0) + system("mv -f " NewCache_ Cytore_ " " NewLibrary_); + else if (access(OldLibrary_ Cytore_, F_OK) == 0) + system("mv -f " OldLibrary_ Cytore_ " " NewLibrary_); + chown(NewLibrary_ Cytore_, 501, 501); + } FixPermissions(); -- 2.47.2