diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2007-08-08 14:53:25 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2007-08-08 14:53:25 +0000 |
| commit | 0f542e12353b98f8fe1f74c96e0d460979f53318 (patch) | |
| tree | 126c744dcd42287925392a85ff9e3c1964087740 /trunk/src | |
| parent | 9f3b378418b775a8ad3b43b7d7baff82435194f0 (diff) | |
| download | gentoolkit-0f542e12353b98f8fe1f74c96e0d460979f53318.tar.gz | |
Fix progress bar to only update when there is a change (Bug #186945)
svn path=/; revision=431
Diffstat (limited to 'trunk/src')
| -rwxr-xr-x | trunk/src/revdep-rebuild/revdep-rebuild-rewrite | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/trunk/src/revdep-rebuild/revdep-rebuild-rewrite b/trunk/src/revdep-rebuild/revdep-rebuild-rewrite index ac3feae..9d9aa6a 100755 --- a/trunk/src/revdep-rebuild/revdep-rebuild-rewrite +++ b/trunk/src/revdep-rebuild/revdep-rebuild-rewrite @@ -70,6 +70,7 @@ declare SEARCH_DIRS # List of dirs to search for executables and libraries declare SEARCH_DIRS_MASK # List of dirs not to search # Other globals: +declare OLDPROG # Previous pass through the progress meter declare EXACT_PKG # Versionated atom to emerge declare HEAD_TEXT # Feedback string about the search declare LIST # Prefix for temporary filenames @@ -162,9 +163,11 @@ progress() { progress() { :; } else progress() { + local curProg=$(( $1 * 100 / $2 )) + (( curProg == OLDPROG )) && return # no change, output nothing + OLDPROG="$curProg" # must be a global variable (( $1 == $2 )) && local lb=$'\n' - echo -ne '\r \r' - echo -n "[ $(( $1 * 100 / $2 ))% ] $lb" + echo -ne '\r \r'"[ $curProg% ] $lb" } progress $@ fi @@ -295,6 +298,12 @@ get_args() { sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:' } fi + + # Use the color preference from portage + export NOCOLOR=$(portageq envvar NOCOLOR) + [[ $NOCOLOR = yes || $NOCOLOR = true ]] && export RC_NOCOLOR=yes # HACK! (grr) + source /etc/init.d/functions.sh + # Normalize some EMERGE_OPTIONS EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-p/--pretend}) EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-f/--fetchonly}) @@ -309,10 +318,6 @@ is_real_merge() [[ ]] get_args "$@" -# Use the color preference from portage -export NOCOLOR=$(portageq envvar NOCOLOR) -[[ $NOCOLOR = yes || $NOCOLOR = true ]] && export RC_NOCOLOR=yes # HACK! (grr) -source /etc/init.d/functions.sh einfo "Configuring search environment for $APP_NAME" |
