summaryrefslogtreecommitdiff
path: root/Cydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2008-05-11 04:48:26 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:08:06 +0000
commit9ea8d15949c5f95593de8abb3dac4e09f952aa38 (patch)
tree3de984f010d14e122f8e7a49e9f992d90997407a /Cydia.mm
parent5a09ae087654d96010c8f5e822033400eef544d2 (diff)
Minor cleanups before release.
Diffstat (limited to 'Cydia.mm')
-rw-r--r--Cydia.mm37
1 files changed, 18 insertions, 19 deletions
diff --git a/Cydia.mm b/Cydia.mm
index 2d94935..9615f54 100644
--- 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)];
- 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;
@@ -1501,10 +1501,6 @@ NSString *Scour(const char *field, const char *begin, const char *end) {
[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]);
@@ -1789,7 +1785,8 @@ void AddTextView(NSMutableDictionary *fields, NSMutableArray *packages, NSString
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];
@@ -2553,16 +2550,18 @@ Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");
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];
@@ -2842,7 +2841,7 @@ Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");
[buttons addObject:@"Cancel"];
[delegate_ slideUp:[[[UIAlertSheet alloc]
- initWithTitle:@"Manage Package"
+ initWithTitle:nil
buttons:buttons
defaultButtonIndex:2
delegate:self
@@ -4655,7 +4654,7 @@ Pcre conffile_r("^'(.*)' '(.*)' ([01]) ([01])$");
}
- (void) slideUp:(UIAlertSheet *)alert {
- [alert presentSheetFromButtonBar:buttonbar_];
+ [alert presentSheetInView:overlay_];
}
@end