diff options
author | Dave Reisner <d@falconindy.com> | 2011-03-17 09:01:30 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-17 10:05:26 -0500 |
commit | 0da6c591c0c4a4a8649f1549d095baa74a4191d9 (patch) | |
tree | 616080dc691ad351b51a10496f52d472add114cd /lib/libalpm | |
parent | e6c9076a74f72d7c5164e2154ce1f47f8886e6e5 (diff) | |
download | pacman-0da6c591c0c4a4a8649f1549d095baa74a4191d9.tar.xz |
Fix triple progress bars on download
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/dload.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 25bb659b..320f84e8 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -47,6 +47,8 @@ #include "util.h" #include "handle.h" +static int prevprogress; /* last download amount */ + static char *get_filename(const char *url) { char *filename = strrchr(url, '/'); if(filename != NULL) { @@ -92,7 +94,7 @@ static int curl_progress(void *filename, double dltotal, double dlnow, (void)ultotal; (void)ulnow; - if(dltotal == 0) { + if(dltotal == 0 || prevprogress == dltotal) { return(0); } @@ -102,6 +104,8 @@ static int curl_progress(void *filename, double dltotal, double dlnow, handle->dlcb((const char*)filename, (long)dlnow, (long)dltotal); + prevprogress = dlnow; + return(0); } |