summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/dload.c
diff options
context:
space:
mode:
authorAnatol Pomozov <anatol.pomozov@gmail.com>2021-03-16 00:33:08 +0100
committerAllan McRae <allan@archlinux.org>2021-03-25 02:39:03 +0100
commit1e60a5f00674a9a9b0c530c741bd6701d0e1e834 (patch)
tree8539fba8183d42179f6b5504f32725bd1901de4c /lib/libalpm/dload.c
parent9bf3d6a7603bf48771a20d1f4bd789670e7446f7 (diff)
downloadpacman-1e60a5f00674a9a9b0c530c741bd6701d0e1e834.tar.gz
pacman-1e60a5f00674a9a9b0c530c741bd6701d0e1e834.tar.xz
Remove "total download" callback in favor of generic event callback
Total download callback called right before packages start downloaded. But we already have an event for such event (ALPM_EVENT_PKG_RETRIEVE_START) and it is naturally to use the event to pass information about expected download size. Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/dload.c')
-rw-r--r--lib/libalpm/dload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 0d0936c7..3e20d335 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -851,7 +851,7 @@ int SYMEXPORT alpm_fetch_pkgurl(alpm_handle_t *handle, const alpm_list_t *urls,
const char *cachedir;
alpm_list_t *payloads = NULL;
const alpm_list_t *i;
- alpm_event_t event;
+ alpm_event_t event = {0};
CHECK_HANDLE(handle, return -1);
ASSERT(*fetched == NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1));
@@ -884,6 +884,7 @@ int SYMEXPORT alpm_fetch_pkgurl(alpm_handle_t *handle, const alpm_list_t *urls,
if(payloads) {
event.type = ALPM_EVENT_PKG_RETRIEVE_START;
+ event.pkg_retrieve.num = alpm_list_count(payloads);
EVENT(handle, &event);
if(_alpm_download(handle, payloads, cachedir) == -1) {
_alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files\n"));