diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-12-22 07:11:20 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-12-22 07:11:20 +0000 |
commit | d8d82215561305cb7af0a33d7810cbb9cadb2cea (patch) | |
tree | ee77b2e7867d524d6d23ee5e2a783ae8bf5bdb53 /src/pacman/downloadprog.c | |
parent | 796490546e2d3868a387ff18b05f2fa382a9aa7e (diff) |
Modified front end output routines to accept a "padding' setting, which pads any
statement with ' ' until the size of the terminal. The rationale is that, when
a log message is emitted during progress bar display, the terminal is artifacted.
This prevents that messiness.
Diffstat (limited to 'src/pacman/downloadprog.c')
-rw-r--r-- | src/pacman/downloadprog.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pacman/downloadprog.c b/src/pacman/downloadprog.c index 06345782..16cfd6c9 100644 --- a/src/pacman/downloadprog.c +++ b/src/pacman/downloadprog.c @@ -65,6 +65,7 @@ void log_progress(const char *filename, int xfered, int total) float total_timediff, timediff; if(xfered == 0) { + set_output_padding(1); /* we need padding from pm_fprintf output */ gettimeofday(&initial_time, NULL); gettimeofday(&last_time, NULL); xfered_last = 0; @@ -88,6 +89,7 @@ void log_progress(const char *filename, int xfered, int total) /* compute final values */ rate = total / (total_timediff * 1024); eta_s = (int)total_timediff; + set_output_padding(0); /* shut off padding */ } else if(timediff < UPDATE_SPEED_SEC) { /* we avoid computing the ETA on too small periods of time, so that results are more significant */ |