index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | morganamilo <morganamilo@archlinux.org> | 2021-01-16 17:12:55 +0000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2021-01-21 17:20:48 +1000 |
commit | ab549c846707230e44e2b7e08c6a04d44af916cd (patch) | |
tree | f06a335ef839d724e4d22c05d4fe468f749393fa /lib | |
parent | b40c5553b43633f4b9bd01310e0ae8ff56147723 (diff) |
-rw-r--r-- | lib/libalpm/sync.c | 16 |
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 2859debb..c742e395 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -755,6 +755,11 @@ static int download_files(alpm_handle_t *handle) cachedir = _alpm_filecache_setup(handle); handle->trans->state = STATE_DOWNLOADING; + ret = find_dl_candidates(handle, &files); + if(ret != 0) { + goto finish; + } + /* Total progress - figure out the total download size if required to * pass to the callback. This function is called once, and it is up to the * frontend to compute incremental progress. */ @@ -762,21 +767,14 @@ static int download_files(alpm_handle_t *handle) off_t total_size = (off_t)0; size_t howmany = 0; /* sum up the download size for each package and store total */ - for(i = handle->trans->add; i; i = i->next) { + for(i = files; i; i = i->next) { alpm_pkg_t *spkg = i->data; total_size += spkg->download_size; - if(spkg->download_size > 0) { - howmany++; - } + howmany++; } handle->totaldlcb(howmany, total_size); } - ret = find_dl_candidates(handle, &files); - if(ret != 0) { - goto finish; - } - if(files) { /* check for necessary disk space for download */ if(handle->checkspace) { |