From e760c4f4784c7e7b59717cd10c56dac04f175b73 Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Wed, 20 Aug 2008 23:17:02 +0200 Subject: download : disable progressbar when total is unknown. This is a work around for FS#8725. There are some bad combination of proxies and mirrors where the Content Length is not returned, and thus the progress bar can't be displayed correctly. Dan: Note that this patch also adds a "downloading" message when the progress bar is disabled, which was formerly not indicated at all in the output. Signed-off-by: Xavier Chantry Signed-off-by: Dan McGee --- src/pacman/callback.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pacman') diff --git a/src/pacman/callback.c b/src/pacman/callback.c index 8d4538c4..a6349874 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -444,7 +444,10 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total) int file_percent = 0, total_percent = 0; char rate_size = 'K', xfered_size = 'K'; - if(config->noprogressbar) { + if(config->noprogressbar || file_total == -1) { + if(file_xfered == 0) { + printf(_("downloading %s...\n"), filename); + } return; } -- cgit v1.2.3-70-g09d2