summaryrefslogtreecommitdiff
path: root/postinst.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-10-30 11:19:43 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-10-30 11:19:43 -0700
commita4a93d599b06516cc112ca683409db0dc619600d (patch)
treeef6aa1afd6f3aa9a857a1181ef5cc2dca275fa5a /postinst.mm
parentf98962e5a9e0baa28f1fca154ebaa33c52bfb654 (diff)
The Cytore metadata should have been in ~/Library.
Diffstat (limited to 'postinst.mm')
-rw-r--r--postinst.mm19
1 files changed, 14 insertions, 5 deletions
diff --git a/postinst.mm b/postinst.mm
index c6dd965..55739e0 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();