]> git.saurik.com Git - cydia.git/commitdiff
Migrate the user's legacy APT lists to new Caches.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Oct 2014 05:22:47 +0000 (22:22 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Oct 2014 05:23:06 +0000 (22:23 -0700)
postinst.mm

index d96d624c0f21ed349aedb8cba193f48b7d1d63b7..7c2fb6835282d2c53aa7b60e70415af268a4f9e0 100644 (file)
@@ -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())