--- revdep-rebuild-rewrite.orig 2007-08-27 13:41:37.000000000 -0400 +++ revdep-rebuild-rewrite 2007-08-27 13:43:26.000000000 -0400 @@ -141,6 +141,7 @@ -i, --ignore Ignore temporary files from previous runs -o, --no-order Do not check the build order (Saves time, but may cause breakage.) + -P, --no-progress Turn off the progress meter -q, --quiet Be less verbose (also passed to emerge command) -v, --verbose Be more verbose -u, --no-util UTIL Do not use features provided by UTIL @@ -159,9 +160,7 @@ # i: current item # n: total number of items to process progress() { - if [[ $quiet ]]; then - progress() { :; } - else + if [[ -t 1 ]]; then progress() { local curProg=$(( $1 * 100 / $2 )) (( curProg == OLDPROG )) && return # no change, output nothing @@ -170,6 +169,8 @@ echo -ne '\r \r'"[ $curProg% ] $lb" } progress $@ + else # STDOUT is not a tty. Disable progress meter. + progress() { :; } fi } # Usage: countdown n @@ -229,8 +230,11 @@ -o|--no-order) unset ORDER_PKGS ;; + -P|--no-progress) + progress() { :; } -q|--quiet) - echo_v() { : ; } + echo_v() { :; } + progress() { :; } quiet=1 EMERGE_OPTIONS+=($1) ;;