From: Jay Freeman (saurik) Date: Tue, 5 May 2009 05:44:41 +0000 (+0000) Subject: Various awesome upgrades. X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/9050015e7807a1dd445e19a6e2537b0269a29ff0?hp=1636cf2976bbc6940ec85b3a41017492db9f17fa Various awesome upgrades. --- diff --git a/Cydia.app/Cydia b/Cydia.app/Cydia index 8356734e..3c723156 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 01b1a77c..3ccfa62f 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 00000000..41c0d70a 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 41c0d70a..00000000 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 00000000..a83f3543 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 a83f3543..00000000 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 00000000..475bda66 --- /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 3330a1bb..00000000 --- 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 00000000..795fa193 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 795fa193..00000000 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 00000000..0b7754cd 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 00000000..1b2e691c 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 0b7754cd..00000000 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 1b2e691c..00000000 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 00000000..631b7ef3 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 631b7ef3..00000000 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 8c79a38d..00000000 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 18885ea9..00000000 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 f2bfcab3..00000000 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 26c96550..00000000 Binary files a/Cydia.app/Sources/repo.smxy.org.png and /dev/null differ diff --git a/Cydia.mm b/Cydia.mm index 4966a1bc..5b3eb805 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 703d3027..c38b2697 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 abfe2edf..4a15ca71 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 10cc1937..fbec7b7c 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 5843ad6e..a7ad6e2e 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 f8edbe1a..0ed2d3e9 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