summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-08-02 21:11:18 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-08-02 21:11:18 +0200
commitb92c8aa4bccd23eacd1a2921dd2535ea1928bdf3 (patch)
treee8bb1cd4cb71c3985882ca87a372831f0118b224 /bin
parent0d5828e2069c51260677df1cc9e24e64a162acd6 (diff)
bin/pkg: progress: Buffer output for less flickering with ssh
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg11
1 files changed, 5 insertions, 6 deletions
diff --git a/bin/pkg b/bin/pkg
index 83c43f3..62479da 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -127,22 +127,21 @@ progress () {
max=$2
desc=$3
desc2=$4
+ output=''
currentper=$[$[$current*100]/$max]
- say () {
- [[ $SILENT = 1 ]] || echo -ne $*
- }
item () {
for j in {0..$1}; {
- [[ $j -gt 0 ]] && say $2
+ [[ $j -gt 0 ]] && output+=$2
}
}
clear_line
c=$[$currentper/5]
a=$[20-$c]
- say "${info}$desc${reset} ["
+ output+="${info}$desc${reset} ["
item $c '='
item $a ' '
- say "] $currentper% $desc2"
+ output+="] $currentper% $desc2"
+ [[ $SILENT = 1 ]] || echo -ne $output
}
## VCS Wrappers