diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-10-16 06:32:15 +0200 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-10-16 06:32:15 +0200 |
commit | 6f5bf3fa545c0e236f425c5a77c4fe1a5ea9a454 (patch) | |
tree | f5301f995d5626bf22443e92d1798314d11481a2 /src | |
parent | 558e49698dcb0a4105acfbd2a12b8125d032083b (diff) | |
download | pacman-6f5bf3fa545c0e236f425c5a77c4fe1a5ea9a454.tar.gz pacman-6f5bf3fa545c0e236f425c5a77c4fe1a5ea9a454.tar.xz |
Adjust progress bar to align with frugalware's progressbar
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/download.c | 18 | ||||
-rw-r--r-- | src/pacman/download.h | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/pacman/download.c b/src/pacman/download.c index 63d2ccbf..2be6e242 100644 --- a/src/pacman/download.c +++ b/src/pacman/download.c @@ -40,7 +40,7 @@ #include "conf.h" /* progress bar */ -char sync_fnm[25]; +char sync_fnm[23]; int offset; struct timeval t0, t; float rate; @@ -104,9 +104,13 @@ int log_progress(netbuf *ctl, int xfered, void *arg) eta_s -= eta_m * 60; } - printf(" %s [", sync_fnm); - cur = (int)((maxcols-64)*pct/100); - for(i = 0; i < maxcols-64; i++) { + if(rate > 1000) { + printf("%s %6dK %6.0fK/s %02d:%02d:%02d [", sync_fnm, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s); + } else { + printf("%s %6dK %6.1fK/s %02d:%02d:%02d [", sync_fnm, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s); + } + cur = (int)((maxcols-57)*pct/100); + for(i = 0; i < maxcols-57; i++) { if(chomp) { if(i < cur) { printf("-"); @@ -134,11 +138,7 @@ int log_progress(netbuf *ctl, int xfered, void *arg) (i < cur) ? printf("#") : printf(" "); } } - if(rate > 1000) { - printf("] %3d%% %6dK %6.0fK/s %02d:%02d:%02d\r", pct, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s); - } else { - printf("] %3d%% %6dK %6.1fK/s %02d:%02d:%02d\r", pct, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s); - } + printf("] %3d%%\r", pct); if(lastpct != 100 && pct == 100) { printf("\n"); } diff --git a/src/pacman/download.h b/src/pacman/download.h index 45afa647..a3ff45c2 100644 --- a/src/pacman/download.h +++ b/src/pacman/download.h @@ -21,7 +21,7 @@ #ifndef _PM_DOWNLOAD_H #define _PM_DOWNLOAD_H -extern char sync_fnm[25]; +extern char sync_fnm[23]; extern int offset; extern struct timeval t0, t; extern float rate; |