]> git.saurik.com Git - cydia.git/commitdiff
Minor cleanups before release.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 11 May 2008 04:48:26 +0000 (04:48 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 07:08:06 +0000 (07:08 +0000)
Cydia.app/Default.png
Cydia.mm

index e83e6f300a3a66f5d7bb098a9154da8d8e954395..b603d4e28655842c259851d1fa39f24cf8cd0315 100644 (file)
Binary files a/Cydia.app/Default.png and b/Cydia.app/Default.png differ
index 2d94935b5a3ad73b06fe5d850b62b041a6fdedcf..9615f54f7726a04c6f0672055242d9d2fee3a76d 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -1464,9 +1464,9 @@ NSString *Scour(const char *field, const char *begin, const char *end) {
             [delegate_ repairWithSelector:@selector(configure)];
         else if (error == "The package lists or status file could not be parsed or opened.")
             [delegate_ repairWithSelector:@selector(update)];
             [delegate_ repairWithSelector:@selector(configure)];
         else if (error == "The package lists or status file could not be parsed or opened.")
             [delegate_ repairWithSelector:@selector(update)];
-        else if (error == "Could not get lock /var/lib/dpkg/lock - open (35 Resource temporarily unavailable)")
-            [delegate_ repairWithSelector:@selector(unlock)];
-        //else if (error == "The list of sources could not be read.")
+        // else if (error == "Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)")
+        // else if (error == "Could not get lock /var/lib/dpkg/lock - open (35 Resource temporarily unavailable)")
+        // else if (error == "The list of sources could not be read.")
         else _assert(false);
 
         return;
         else _assert(false);
 
         return;
@@ -1501,10 +1501,6 @@ NSString *Scour(const char *field, const char *begin, const char *end) {
     [packages_ sortUsingSelector:@selector(compareByName:)];
 }
 
     [packages_ sortUsingSelector:@selector(compareByName:)];
 }
 
-- (void) unlock {
-    system("killall dpkg");
-}
-
 - (void) configure {
     NSString *dpkg = [NSString stringWithFormat:@"dpkg --configure -a --status-fd %u", statusfd_];
     system([dpkg UTF8String]);
 - (void) configure {
     NSString *dpkg = [NSString stringWithFormat:@"dpkg --configure -a --status-fd %u", statusfd_];
     system([dpkg UTF8String]);
@@ -1789,7 +1785,8 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
         CGRect bounds = [overlay_ bounds];
 
         navbar_ = [[UINavigationBar alloc] initWithFrame:navrect];
         CGRect bounds = [overlay_ bounds];
 
         navbar_ = [[UINavigationBar alloc] initWithFrame:navrect];
-        [navbar_ setBarStyle:1];
+        if (Advanced_)
+            [navbar_ setBarStyle:1];
         [navbar_ setDelegate:self];
 
         UINavigationItem *navitem = [[[UINavigationItem alloc] initWithTitle:@"Confirm"] autorelease];
         [navbar_ setDelegate:self];
 
         UINavigationItem *navitem = [[[UINavigationItem alloc] initWithTitle:@"Confirm"] autorelease];
@@ -2553,16 +2550,18 @@ Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");
         package_ = [package retain];
         name_ = [[package id] retain];
 
         package_ = [package retain];
         name_ = [[package id] retain];
 
-        NSString *list = [NSString
-            stringWithContentsOfFile:[NSString stringWithFormat:@"/var/lib/dpkg/info/%@.list", name_]
-            encoding:kCFStringEncodingUTF8
-            error:NULL
-        ];
+        NSString *path = [NSString stringWithFormat:@"/var/lib/dpkg/info/%@.list", name_];
+
+        {
+            std::ifstream fin([path UTF8String]);
+            std::string line;
+            while (std::getline(fin, line))
+                [files_ addObject:[NSString stringWithUTF8String:line.c_str()]];
+        }
 
 
-        if (list != nil) {
-            [files_ addObjectsFromArray:[list componentsSeparatedByString:@"\n"]];
-            [files_ removeLastObject];
-            [files_ removeObjectAtIndex:0];
+        if ([files_ count] != 0) {
+            if ([[files_ objectAtIndex:0] isEqualToString:@"/."])
+                [files_ removeObjectAtIndex:0];
             [files_ sortUsingSelector:@selector(compareByPath:)];
 
             NSMutableArray *stack = [NSMutableArray arrayWithCapacity:8];
             [files_ sortUsingSelector:@selector(compareByPath:)];
 
             NSMutableArray *stack = [NSMutableArray arrayWithCapacity:8];
@@ -2842,7 +2841,7 @@ Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");
         [buttons addObject:@"Cancel"];
 
         [delegate_ slideUp:[[[UIAlertSheet alloc]
         [buttons addObject:@"Cancel"];
 
         [delegate_ slideUp:[[[UIAlertSheet alloc]
-            initWithTitle:@"Manage Package"
+            initWithTitle:nil
             buttons:buttons
             defaultButtonIndex:2
             delegate:self
             buttons:buttons
             defaultButtonIndex:2
             delegate:self
@@ -4655,7 +4654,7 @@ Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");
 }
 
 - (void) slideUp:(UIAlertSheet *)alert {
 }
 
 - (void) slideUp:(UIAlertSheet *)alert {
-    [alert presentSheetFromButtonBar:buttonbar_];
+    [alert presentSheetInView:overlay_];
 }
 
 @end
 }
 
 @end