[pacman-dev] [PATCH] callback.c: only print download status message once with --noprogressbar
Syncing repos and downloading packages with --noprogressbar specified often prints the status message "downloading $foo..." to several lines in a row. --- src/pacman/callback.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pacman/callback.c b/src/pacman/callback.c index ab3e14f..468d657 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -680,8 +680,10 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) if(config->noprogressbar || cols == 0 || file_total == -1) { if(file_xfered == 0) { - printf(_("downloading %s...\n"), filename); + printf(_("downloading %s...\r"), filename); fflush(stdout); + } else if(file_xfered == file_total) { + putchar('\n'); } return; } -- 2.8.3
On 08/06/16 07:01, Ivy Foster wrote:
Syncing repos and downloading packages with --noprogressbar specified often prints the status message "downloading $foo..." to several lines in a row. --- src/pacman/callback.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pacman/callback.c b/src/pacman/callback.c index ab3e14f..468d657 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -680,8 +680,10 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
if(config->noprogressbar || cols == 0 || file_total == -1) { if(file_xfered == 0) { - printf(_("downloading %s...\n"), filename); + printf(_("downloading %s...\r"), filename); fflush(stdout); + } else if(file_xfered == file_total) { + putchar('\n'); } return; }
I'm not going to accept this because it is just papering over the underlying issue. From memory, there was a thread about fixing the root cause of this about a year ago. I'm not sure where than went. Allan
On 09 Jun 2016, at 4:01 pm +1000, Allan McRae wrote:
On 08/06/16 07:01, Ivy Foster wrote:
Syncing repos and downloading packages with --noprogressbar specified often prints the status message "downloading $foo..." to several lines in a row. --- src/pacman/callback.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) [...]
I'm not going to accept this because it is just papering over the underlying issue. From memory, there was a thread about fixing the root cause of this about a year ago. I'm not sure where than went.
Ah, that's fair enough. I found the thread[1], and I'm game to try putting together whatever solution seems best. [1]: https://lists.archlinux.org/pipermail/pacman-dev/2015-May/020094.html Cheers, Ivy
participants (2)
-
Allan McRae
-
Ivy Foster