summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/dload.c
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-03-21 11:53:52 +0100
committerDan McGee <dan@archlinux.org>2011-03-21 13:51:27 +0100
commitc67c864ffd50ec0e071b055897c4622eaa132fc2 (patch)
tree90c2993b3fe7366177aa74184965d6dbb8a032b3 /lib/libalpm/dload.c
parent488f341f57a1533397e33de9c749dbe778a1cbd4 (diff)
downloadpacman-c67c864ffd50ec0e071b055897c4622eaa132fc2.tar.gz
pacman-c67c864ffd50ec0e071b055897c4622eaa132fc2.tar.xz
Don't initialize progress to zero before calling curl_easy_perform().
Drawing progress bars before calling curl_easy_perform() is needless as the curl progress callback is called with zero progress before actually downloading the file anyways. Fixes display of "0%" progress bars when sync'ing package databases that are already up to date. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/dload.c')
-rw-r--r--lib/libalpm/dload.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 121ba86d..4347e5db 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -214,10 +214,9 @@ static int curl_download_internal(const char *url, const char *localpath,
sigaction(SIGINT, NULL, &sig_int[OLD]);
sigaction(SIGINT, &sig_int[NEW], NULL);
- /* Progress 0 - initialize */
- if(handle->dlcb) {
- handle->dlcb(filename, 0, 1);
- }
+ /* set initial value of prevprogress to -1 which causes curl_progress() to
+ * initialize the progress bar with 0% once. */
+ prevprogress = -1;
/* perform transfer */
handle->curlerr = curl_easy_perform(handle->curl);