From 1e60a5f00674a9a9b0c530c741bd6701d0e1e834 Mon Sep 17 00:00:00 2001 From: Anatol Pomozov Date: Mon, 15 Mar 2021 16:33:08 -0700 Subject: 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 Signed-off-by: Allan McRae --- lib/libalpm/dload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/dload.c') 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")); -- cgit v1.2.3-54-g00ecf