diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-10-10 14:59:05 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-10-10 14:59:05 +0200 |
commit | 03f79126b7fee54e0079da5d59794b5683036c39 (patch) | |
tree | e387beb70c9b9bee9c70a774370096b0f669ea52 | |
parent | 887422da2bdc7b90a264d8766c4f97f33f0048cb (diff) |
ct: Simplified wrap()
-rwxr-xr-x | bin/ct | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -672,27 +672,26 @@ function wrap { typeset -a packages shift 2 - if (( $# == 1 )) { - $function $1 - } else { + if [[ $# == 1 || $loop_all == 0 ]] { - if (( loop_all )) { - packages=(*(-/)) - } else { - packages=($*) + for package in $*; { + cd $PKG_DIR + $function $package } - [[ -n $progress ]] && all=$(list_packages_local | wc -l) - [[ -n $progress ]] && current=0 + } else { + + all=$(list_packages_local | wc -l) + current=0 - for package in $packages; { + for package in *(-/); { cd $PKG_DIR (( current++ )) - [[ -n $progress && $loop_all == 1 ]] && progress $current $all $progress $package + progress $current $all $progress $package $function $package } - [[ -n $progress ]] && clear_line + clear_line } } |