From 03f79126b7fee54e0079da5d59794b5683036c39 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 10 Oct 2009 14:59:05 +0200 Subject: ct: Simplified wrap() --- bin/ct | 23 +++++++++++------------ 1 file 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 } } -- cgit v1.2.3