summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2015-07-02 08:46:27 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2015-07-02 08:46:27 -0700
commit49cc457aa95e5bb3f5b461c607ab4e0d8f94b499 (patch)
tree0ededcefc9f8148683faf1a9df303c29869dca3e
parent93524d32b3c75083549e3871dcd10db30c94283d (diff)
Wrap extended_states update using a symbolic link.
-rw-r--r--MobileCydia.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 75d2842..95e5a40 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4090,7 +4090,14 @@ class CydiaLogCleaner :
delock_ = nil;
+ NSString *oextended(@"/var/lib/apt/extended_states");
+ NSString *nextended(Cache("extended_states"));
pkgPackageManager::OrderResult result(manager_->DoInstall(statusfd_));
+ system([[NSString stringWithFormat:@"/usr/libexec/cydia/cydo /bin/mv -f %@ %@", nextended, oextended] UTF8String]);
+ system([[NSString stringWithFormat:@"/usr/libexec/cydia/cydo /bin/chown 0:0 %@", oextended] UTF8String]);
+ unlink([nextended UTF8String]);
+ symlink([oextended UTF8String], [nextended UTF8String]);
+
if ([self popErrorWithTitle:title])
return;
@@ -10435,6 +10442,9 @@ int main(int argc, char *argv[]) {
mkdir([Cache("archives/partial") UTF8String], 0755);
_config->Set("Dir::Cache", [Cache_ UTF8String]);
+ symlink("/var/lib/apt/extended_states", [Cache("extended_states") UTF8String]);
+ _config->Set("Dir::State", [Cache_ UTF8String]);
+
mkdir([Cache("lists") UTF8String], 0755);
mkdir([Cache("lists/partial") UTF8String], 0755);
mkdir([Cache("periodic") UTF8String], 0755);