summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-10-10 14:59:05 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-10-10 14:59:05 +0200
commit03f79126b7fee54e0079da5d59794b5683036c39 (patch)
treee387beb70c9b9bee9c70a774370096b0f669ea52
parent887422da2bdc7b90a264d8766c4f97f33f0048cb (diff)
ct: Simplified wrap()
-rwxr-xr-xbin/ct23
1 files changed, 11 insertions, 12 deletions
diff --git a/bin/ct b/bin/ct
index 467a451..00e325d 100755
--- a/bin/ct
+++ b/bin/ct
@@ -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
}
}