diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-06 19:49:43 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-01-06 19:49:43 +0100 |
commit | f0b31c94a2647b5161a46adb860b9b28112558ea (patch) | |
tree | bcab80984e789cb3fb65e945de70e444f17f9a36 | |
parent | 8f3c9be9bae336fe90c08ab783fee92645e1003c (diff) |
pkg: Added wrap_info to prefix output if neccessary (e.g. in pkg refresh)
[zsh fun fact: One cannot set aliases in functions]
-rwxr-xr-x | bin/pkg | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -183,6 +183,8 @@ function confirm_no { ## Major internal functions ## +function wrap_info {} + function progress { (( SILENT )) && return current=$1 @@ -351,6 +353,7 @@ function global_hook { triggers+=$1 check_prereqs $1 if [[ -r Makefile ]] { + wrap_info $1 info "Running make\n" make } @@ -384,7 +387,8 @@ function check_prereqs { package=$1 [[ -r $PDIR/$package/prereqs ]] || return 0 cd $PDIR/$package - info "$package: checking prerequisites\n" + wrap_info $1 + info "checking prerequisites\n" typeset -a install typeset warn @@ -438,10 +442,7 @@ function populate_collected { cd $PDIR/$1 || return typeset -i bins=0 bino=0 mans=0 mano=0 - if (( wrapped )) { - clear_line - info "$1: " - } + wrap_info $1 info "Enabling documentation " if [[ -d man ]] { for i in man/*/*; { @@ -471,7 +472,7 @@ function populate_collected { } clear_line if (( bins + mans > 0 )) { - (( wrapped )) && info "$1: " + wrap_info $1 info "Compiled documentation " say -n '(' if (( bins + bino > 0 )) { @@ -502,6 +503,7 @@ function populate_collected { # TODO: Make sure there are none function genocide_collected { cd $PDIR/$1 || return + wrap_info $1 info "Removing documentation" if [[ -d man ]] { for i in man/*/*; { @@ -555,6 +557,10 @@ function wrap { $function $2 } else { wrapped=1 + function wrap_info { + clear_line + info "$1: " + } cd $PDIR [[ -n $progress ]] && all=$(wc -l < $PDIR/.list) [[ -n $progress ]] && current=0 @@ -653,7 +659,7 @@ function pkg_refresh { check_installed $1 cd $PDIR/$1 if [[ -r Makefile ]] { - clear_line + wrap_info info "Cleaning build diroctery\n" make clean } |