summaryrefslogtreecommitdiff
path: root/postinst.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2014-10-29 22:22:47 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2014-10-29 22:23:06 -0700
commite3799a2e08946d914e75ae16d8286868660ba862 (patch)
tree04b4e2e37ef2eb148a2044e4e102d21140b78986 /postinst.mm
parent6b19945f707e72f10b35268bfab01eae0f18eee2 (diff)
Migrate the user's legacy APT lists to new Caches.
Diffstat (limited to 'postinst.mm')
-rw-r--r--postinst.mm7
1 files changed, 7 insertions, 0 deletions
diff --git a/postinst.mm b/postinst.mm
index d96d624..7c2fb68 100644
--- a/postinst.mm
+++ b/postinst.mm
@@ -172,6 +172,13 @@ int main(int argc, const char *argv[]) {
if (access(OldCache_, F_OK) == 0)
system("rm -rf " OldCache_);
+ #define NewCache_ "/var/mobile/Library/Caches/com.saurik.Cydia"
+ if (access(NewCache_ "/lists", F_OK) != 0 && errno == ENOENT) {
+ system("su -c 'mkdir -p " NewCache_ "' mobile");
+ system("cp -at " NewCache_ " /var/lib/apt/lists");
+ system("chown -R 501.501 " NewCache_ "/lists");
+ }
+
FixPermissions();
if (FixApplications())