From 6204f56a7d810316e2b93ef0214ca1c931c4c889 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 5 May 2009 05:44:41 +0000 Subject: Various awesome upgrades. --- Cydia.app/Cydia | 5 +- Cydia.app/English.lproj/Localizable.strings | 1 + Cydia.app/Modes/DOWNGRADE.png | Bin 0 -> 1176 bytes Cydia.app/Modes/Downgrade.png | Bin 1176 -> 0 bytes Cydia.app/Modes/INSTALL.png | Bin 0 -> 2135 bytes Cydia.app/Modes/Install.png | Bin 2135 -> 0 bytes Cydia.app/Modes/NEW_INSTALL.png | 1 + Cydia.app/Modes/New Install.png | 1 - Cydia.app/Modes/PURGE.png | Bin 0 -> 2443 bytes Cydia.app/Modes/Purge.png | Bin 2443 -> 0 bytes Cydia.app/Modes/REINSTALL.png | Bin 0 -> 2013 bytes Cydia.app/Modes/REMOVE.png | Bin 0 -> 2552 bytes Cydia.app/Modes/Reinstall.png | Bin 2013 -> 0 bytes Cydia.app/Modes/Remove.png | Bin 2552 -> 0 bytes Cydia.app/Modes/UPGRADE.png | Bin 0 -> 1635 bytes Cydia.app/Modes/Upgrade.png | Bin 1635 -> 0 bytes Cydia.app/Sources/apt.bigboss.us.com.png | Bin 6405 -> 0 bytes Cydia.app/Sources/apt.modmyi.com.png | Bin 5186 -> 0 bytes Cydia.app/Sources/apt.saurik.com.png | Bin 1952 -> 0 bytes Cydia.app/Sources/repo.smxy.org.png | Bin 737 -> 0 bytes Cydia.mm | 156 ++++++++++++++++++---------- Library/free.sh | 1 + Library/move.sh | 2 +- UICaboodle/BrowserView.m | 3 +- control | 4 +- make.sh | 2 +- 26 files changed, 111 insertions(+), 65 deletions(-) create mode 100644 Cydia.app/Modes/DOWNGRADE.png delete mode 100644 Cydia.app/Modes/Downgrade.png create mode 100644 Cydia.app/Modes/INSTALL.png delete mode 100644 Cydia.app/Modes/Install.png create mode 120000 Cydia.app/Modes/NEW_INSTALL.png delete mode 120000 Cydia.app/Modes/New Install.png create mode 100644 Cydia.app/Modes/PURGE.png delete mode 100644 Cydia.app/Modes/Purge.png create mode 100644 Cydia.app/Modes/REINSTALL.png create mode 100644 Cydia.app/Modes/REMOVE.png delete mode 100644 Cydia.app/Modes/Reinstall.png delete mode 100644 Cydia.app/Modes/Remove.png create mode 100644 Cydia.app/Modes/UPGRADE.png delete mode 100644 Cydia.app/Modes/Upgrade.png delete mode 100644 Cydia.app/Sources/apt.bigboss.us.com.png delete mode 100644 Cydia.app/Sources/apt.modmyi.com.png delete mode 100644 Cydia.app/Sources/apt.saurik.com.png delete mode 100644 Cydia.app/Sources/repo.smxy.org.png diff --git a/Cydia.app/Cydia b/Cydia.app/Cydia index 8356734..3c72315 100755 --- a/Cydia.app/Cydia +++ b/Cydia.app/Cydia @@ -1,5 +1,6 @@ #!/bin/bash -Cydia=$(dirname "$0") +C=/${0} +C=${C%/*} declare -a flags [[ :${DYLD_INSERT_LIBRARIES}: == */MobileSubstrate.dylib: ]] && flags[${#flags[@]}]=--substrate -exec "${Cydia}"/Cydia_ "${flags[@]}" -- "$@" 2>>/tmp/cydia.log +exec "${C:-.}"/Cydia_ "${flags[@]}" -- "$@" 2>>/tmp/cydia.log diff --git a/Cydia.app/English.lproj/Localizable.strings b/Cydia.app/English.lproj/Localizable.strings index 01b1a77..3ccfa62 100644 --- a/Cydia.app/English.lproj/Localizable.strings +++ b/Cydia.app/English.lproj/Localizable.strings @@ -95,6 +95,7 @@ "LOGIN" = "Login"; "MAINTAINER" = "Contact"; "MANAGE" = "Manage"; +"MODIFICATIONS" = "Modifications"; "MODIFY" = "Modify"; "MORE_INFORMATION" = "More Information"; "MORE_PACKAGE_SOURCES" = "More Package Sources"; diff --git a/Cydia.app/Modes/DOWNGRADE.png b/Cydia.app/Modes/DOWNGRADE.png new file mode 100644 index 0000000..41c0d70 Binary files /dev/null and b/Cydia.app/Modes/DOWNGRADE.png differ diff --git a/Cydia.app/Modes/Downgrade.png b/Cydia.app/Modes/Downgrade.png deleted file mode 100644 index 41c0d70..0000000 Binary files a/Cydia.app/Modes/Downgrade.png and /dev/null differ diff --git a/Cydia.app/Modes/INSTALL.png b/Cydia.app/Modes/INSTALL.png new file mode 100644 index 0000000..a83f354 Binary files /dev/null and b/Cydia.app/Modes/INSTALL.png differ diff --git a/Cydia.app/Modes/Install.png b/Cydia.app/Modes/Install.png deleted file mode 100644 index a83f354..0000000 Binary files a/Cydia.app/Modes/Install.png and /dev/null differ diff --git a/Cydia.app/Modes/NEW_INSTALL.png b/Cydia.app/Modes/NEW_INSTALL.png new file mode 120000 index 0000000..475bda6 --- /dev/null +++ b/Cydia.app/Modes/NEW_INSTALL.png @@ -0,0 +1 @@ +INSTALL.png \ No newline at end of file diff --git a/Cydia.app/Modes/New Install.png b/Cydia.app/Modes/New Install.png deleted file mode 120000 index 3330a1b..0000000 --- a/Cydia.app/Modes/New Install.png +++ /dev/null @@ -1 +0,0 @@ -Install.png \ No newline at end of file diff --git a/Cydia.app/Modes/PURGE.png b/Cydia.app/Modes/PURGE.png new file mode 100644 index 0000000..795fa19 Binary files /dev/null and b/Cydia.app/Modes/PURGE.png differ diff --git a/Cydia.app/Modes/Purge.png b/Cydia.app/Modes/Purge.png deleted file mode 100644 index 795fa19..0000000 Binary files a/Cydia.app/Modes/Purge.png and /dev/null differ diff --git a/Cydia.app/Modes/REINSTALL.png b/Cydia.app/Modes/REINSTALL.png new file mode 100644 index 0000000..0b7754c Binary files /dev/null and b/Cydia.app/Modes/REINSTALL.png differ diff --git a/Cydia.app/Modes/REMOVE.png b/Cydia.app/Modes/REMOVE.png new file mode 100644 index 0000000..1b2e691 Binary files /dev/null and b/Cydia.app/Modes/REMOVE.png differ diff --git a/Cydia.app/Modes/Reinstall.png b/Cydia.app/Modes/Reinstall.png deleted file mode 100644 index 0b7754c..0000000 Binary files a/Cydia.app/Modes/Reinstall.png and /dev/null differ diff --git a/Cydia.app/Modes/Remove.png b/Cydia.app/Modes/Remove.png deleted file mode 100644 index 1b2e691..0000000 Binary files a/Cydia.app/Modes/Remove.png and /dev/null differ diff --git a/Cydia.app/Modes/UPGRADE.png b/Cydia.app/Modes/UPGRADE.png new file mode 100644 index 0000000..631b7ef Binary files /dev/null and b/Cydia.app/Modes/UPGRADE.png differ diff --git a/Cydia.app/Modes/Upgrade.png b/Cydia.app/Modes/Upgrade.png deleted file mode 100644 index 631b7ef..0000000 Binary files a/Cydia.app/Modes/Upgrade.png and /dev/null differ diff --git a/Cydia.app/Sources/apt.bigboss.us.com.png b/Cydia.app/Sources/apt.bigboss.us.com.png deleted file mode 100644 index 8c79a38..0000000 Binary files a/Cydia.app/Sources/apt.bigboss.us.com.png and /dev/null differ diff --git a/Cydia.app/Sources/apt.modmyi.com.png b/Cydia.app/Sources/apt.modmyi.com.png deleted file mode 100644 index 18885ea..0000000 Binary files a/Cydia.app/Sources/apt.modmyi.com.png and /dev/null differ diff --git a/Cydia.app/Sources/apt.saurik.com.png b/Cydia.app/Sources/apt.saurik.com.png deleted file mode 100644 index f2bfcab..0000000 Binary files a/Cydia.app/Sources/apt.saurik.com.png and /dev/null differ diff --git a/Cydia.app/Sources/repo.smxy.org.png b/Cydia.app/Sources/repo.smxy.org.png deleted file mode 100644 index 26c9655..0000000 Binary files a/Cydia.app/Sources/repo.smxy.org.png and /dev/null differ diff --git a/Cydia.mm b/Cydia.mm index 4966a1b..5b3eb80 100644 --- a/Cydia.mm +++ b/Cydia.mm @@ -1423,6 +1423,7 @@ typedef std::map< unsigned long, _H > SourceMap; /* Source Class {{{ */ @interface Source : NSObject { + CYString depiction_; CYString description_; CYString label_; CYString origin_; @@ -1445,6 +1446,7 @@ typedef std::map< unsigned long, _H > SourceMap; - (NSComparisonResult) compareByNameAndType:(Source *)source; +- (NSString *) depictionForPackage:(NSString *)package; - (NSString *) supportForPackage:(NSString *)package; - (NSDictionary *) record; @@ -1476,6 +1478,7 @@ typedef std::map< unsigned long, _H > SourceMap; description_.clear(); label_.clear(); origin_.clear(); + depiction_.clear(); support_.clear(); version_.clear(); defaultIcon_.clear(); @@ -1533,6 +1536,7 @@ typedef std::map< unsigned long, _H > SourceMap; CYString *value_; } names[] = { {"default-icon", &defaultIcon_}, + {"depiction", &depiction_}, {"description", &description_}, {"label", &label_}, {"origin", &origin_}, @@ -1587,6 +1591,10 @@ typedef std::map< unsigned long, _H > SourceMap; return [lhs compare:rhs options:LaxCompareOptions_]; } +- (NSString *) depictionForPackage:(NSString *)package { + return depiction_.empty() ? nil : [depiction_ stringByReplacingOccurrencesOfString:@"*" withString:package]; +} + - (NSString *) supportForPackage:(NSString *)package { return support_.empty() ? nil : [support_ stringByReplacingOccurrencesOfString:@"*" withString:package]; } @@ -2094,6 +2102,8 @@ struct PackageNameOrdering : _end } + visible_ = true; + _profile(Package$initWithVersion$Tags) pkgCache::TagIterator tag(iterator_.TagList()); if (!tag.end()) { @@ -2101,8 +2111,12 @@ struct PackageNameOrdering : do { const char *name(tag.Name()); [tags_ addObject:(NSString *)CFCString(name)]; - if (role_ == nil && strncmp(name, "role::", 6) == 0) + if (role_ == nil && strncmp(name, "role::", 6) == 0 && strcmp(name, "role::leaper") != 0) role_ = (NSString *) CFCString(name + 6); + if (visible_ && strncmp(name, "require::", 9) == 0 && ( + true + )) + visible_ = false; ++tag; } while (!tag.end()); } @@ -2162,7 +2176,7 @@ struct PackageNameOrdering : _end essential_ = ((iterator_->Flags & pkgCache::Flag::Essential) == 0 ? NO : YES) || [self hasTag:@"cydia::essential"]; - visible_ = [self hasSupportingRole] && [self unfiltered]; + visible_ &&= [self hasSupportingRole] && [self unfiltered]; } _end } return self; } @@ -2428,7 +2442,7 @@ struct PackageNameOrdering : } - (NSString *) depiction { - return depiction_; + return !depiction_.empty() ? depiction_ : [[self source] depictionForPackage:id_]; } - (Address *) sponsor { @@ -3331,6 +3345,8 @@ static NSArray *Finishes_; for (pkgAcquire::ItemIterator item = fetcher_->ItemsBegin(); item != fetcher_->ItemsEnd(); item++) { if ((*item)->Status == pkgAcquire::Item::StatDone && (*item)->Complete) continue; + if ((*item)->Status == pkgAcquire::Item::StatIdle) + continue; std::string uri = (*item)->DescURI(); std::string error = (*item)->ErrorText; @@ -3991,64 +4007,25 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [transition_ transition:6 toView:view_]; } -- (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button { - NSString *context([sheet context]); - - if ([context isEqualToString:@"error"]) - [sheet dismiss]; - else if ([context isEqualToString:@"conffile"]) { - FILE *input = [database_ input]; - - switch (button) { - case 1: - fprintf(input, "N\n"); - fflush(input); - break; - case 2: - fprintf(input, "Y\n"); - fflush(input); - break; - default: - _assert(false); - } - - [sheet dismiss]; - } -} - -- (void) closeButtonPushed { - running_ = NO; - - switch (Finish_) { - case 0: - [self resetView]; - break; - - case 1: - [delegate_ suspendWithAnimation:YES]; - break; +- (void) _checkError { + if (_error->PendingError()) { + std::string error; + if (!_error->PopMessage(error)) + _assert(false); - case 2: - system("launchctl stop com.apple.SpringBoard"); - break; + UIActionSheet *sheet = [[[UIActionSheet alloc] + initWithTitle:CYLocalize("ERROR") + buttons:[NSArray arrayWithObjects:CYLocalize("OKAY"), nil] + defaultButtonIndex:0 + delegate:self + context:@"_error" + ] autorelease]; - case 3: - system("launchctl unload "SpringBoard_"; launchctl load "SpringBoard_); - break; + [sheet setBodyText:[NSString stringWithUTF8String:error.c_str()]]; + [sheet popupAlertAnimated:YES]; - case 4: - system("reboot"); - break; + return; } -} - -- (void) _retachThread { - UINavigationItem *item = [navbar_ topItem]; - [item setTitle:CYLocalize("COMPLETE")]; - - [overlay_ addSubview:close_]; - [progress_ removeFromSuperview]; - [status_ removeFromSuperview]; [delegate_ progressViewIsComplete:self]; @@ -4137,6 +4114,71 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [delegate_ setStatusBarShowsProgress:NO]; } +- (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button { + NSString *context([sheet context]); + + if ([context isEqualToString:@"error"]) + [sheet dismiss]; + else if ([context isEqualToString:@"_error"]) { + [sheet dismiss]; + [self _checkError]; + } else if ([context isEqualToString:@"conffile"]) { + FILE *input = [database_ input]; + + switch (button) { + case 1: + fprintf(input, "N\n"); + fflush(input); + break; + case 2: + fprintf(input, "Y\n"); + fflush(input); + break; + default: + _assert(false); + } + + [sheet dismiss]; + } +} + +- (void) closeButtonPushed { + running_ = NO; + + switch (Finish_) { + case 0: + [self resetView]; + break; + + case 1: + [delegate_ suspendWithAnimation:YES]; + break; + + case 2: + system("launchctl stop com.apple.SpringBoard"); + break; + + case 3: + system("launchctl unload "SpringBoard_"; launchctl load "SpringBoard_); + break; + + case 4: + system("reboot"); + break; + } +} + +- (void) _retachThread { + UINavigationItem *item = [navbar_ topItem]; + [item setTitle:CYLocalize("COMPLETE")]; + + [overlay_ addSubview:close_]; + [progress_ removeFromSuperview]; + [status_ removeFromSuperview]; + + [self _checkError]; +} + - (void) _detachNewThreadData:(ProgressData *)data { _pooled [[data target] performSelector:[data selector] withObject:[data object]]; [data release]; diff --git a/Library/free.sh b/Library/free.sh index 703d302..c38b269 100755 --- a/Library/free.sh +++ b/Library/free.sh @@ -5,6 +5,7 @@ for dir in \ /Library/Wallpaper \ /Library/Ringtones \ /usr/include \ + /usr/lib/pam \ /usr/libexec \ /usr/share \ ; do diff --git a/Library/move.sh b/Library/move.sh index abfe2ed..4a15ca7 100755 --- a/Library/move.sh +++ b/Library/move.sh @@ -45,7 +45,7 @@ function shift_() { dir=${1%/} if [[ -d ${dir} && ! -h ${dir} ]]; then - used=$(du -bs "${dir}") + used=$(/usr/libexec/cydia/du -bs "${dir}") used=${used%%$'\t'*} free=$(df_ /var) diff --git a/UICaboodle/BrowserView.m b/UICaboodle/BrowserView.m index 10cc193..fbec7b7 100644 --- a/UICaboodle/BrowserView.m +++ b/UICaboodle/BrowserView.m @@ -240,7 +240,8 @@ _assert(dup2(fds[1], 1) != -1); _assert(close(fds[0]) != -1); _assert(close(fds[1]) != -1); - execlp("du", "du", "-s", [path UTF8String], NULL); + /* XXX: this should probably not use du */ + execl("/usr/libexec/cydia/du", "du", "-s", [path UTF8String], NULL); exit(1); _assert(false); } diff --git a/control b/control index 5843ad6..a7ad6e2 100644 --- a/control +++ b/control @@ -3,9 +3,9 @@ Priority: required Section: Packaging Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 1.0.2847-1 +Version: 1.0.2881-1 Replaces: com.sosiphone.addcydia -Depends: apr, apt7, darwintools, pcre, shell-cmds, system-cmds +Depends: apr-lib, apt7-lib, darwintools, pcre, shell-cmds, system-cmds Pre-Depends: dpkg (>= 1.14.25-8) Conflicts: com.sosiphone.addcydia Description: graphical iPhone front-end for APT diff --git a/make.sh b/make.sh index f8edbe1..0ed2d3e 100755 --- a/make.sh +++ b/make.sh @@ -1,2 +1,2 @@ #!/bin/bash -/apl/tel/exec.sh :apr:apr-lib:apt7:pcre make package +/apl/tel/exec.sh :apr:apr-lib:apt7:apt7-lib:pcre make package -- cgit v1.2.3