diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2007-09-13 17:23:17 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2007-09-13 17:23:17 +0000 |
| commit | d13add21797eb23824063cdf986890fb2dd76b68 (patch) | |
| tree | a0bbd518340437fed57b5234eab5537c0dc11ec1 /trunk/src | |
| parent | 9442a752463ee0dcb82b5c2658601612e2ab8d8a (diff) | |
| download | gentoolkit-d13add21797eb23824063cdf986890fb2dd76b68.tar.gz | |
Add --no-progress option
svn path=/; revision=438
Diffstat (limited to 'trunk/src')
| -rwxr-xr-x | trunk/src/revdep-rebuild/revdep-rebuild-rewrite | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/trunk/src/revdep-rebuild/revdep-rebuild-rewrite b/trunk/src/revdep-rebuild/revdep-rebuild-rewrite index 36697fb..6d622e2 100755 --- a/trunk/src/revdep-rebuild/revdep-rebuild-rewrite +++ b/trunk/src/revdep-rebuild/revdep-rebuild-rewrite @@ -117,6 +117,7 @@ Broken reverse dependency rebuilder. -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 @@ -135,9 +136,7 @@ EOF # 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 @@ -146,6 +145,8 @@ progress() { echo -ne '\r \r'"[ $curProg% ] $lb" } progress $@ + else # STDOUT is not a tty. Disable progress meter. + progress() { :; } fi } # Usage: countdown n @@ -205,8 +206,11 @@ get_args() { -o|--no-order) unset ORDER_PKGS ;; + -P|--no-progress) + progress() { :; } -q|--quiet) - echo_v() { : ; } + echo_v() { :; } + progress() { :; } quiet=1 EMERGE_OPTIONS+=($1) ;; |
