From 64c4669f579dc5ad8d05329abffbd752ad0ed8f2 Mon Sep 17 00:00:00 2001 From: Anatol Pomozov Date: Tue, 5 May 2020 18:28:49 -0700 Subject: Introduce event types for start/end database list download Multiplexed database/files downloads will use multiple progress bars. The UI logic is quite complicated and printing error messages while handling multiple progress bars is going to be challenging. Instead we are going to save all ALPM error messages to a list and flush it at the end of the download process. Use on_progress variable that blocks error messages printing. Signed-off-by: Anatol Pomozov Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 8a9dcae8..855ca69c 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -812,9 +812,9 @@ static int download_files(alpm_handle_t *handle) } } - event.type = ALPM_EVENT_RETRIEVE_START; + event.type = ALPM_EVENT_PKG_RETRIEVE_START; EVENT(handle, &event); - event.type = ALPM_EVENT_RETRIEVE_DONE; + event.type = ALPM_EVENT_PKG_RETRIEVE_DONE; for(i = files; i; i = i->next) { const alpm_pkg_t *pkg = i->data; struct dload_payload payload = {0}; @@ -825,7 +825,7 @@ static int download_files(alpm_handle_t *handle) if(download_single_file(handle, &payload, cachedir) == -1) { errors++; - event.type = ALPM_EVENT_RETRIEVE_FAILED; + event.type = ALPM_EVENT_PKG_RETRIEVE_FAILED; _alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files\n")); } _alpm_dload_payload_reset(&payload); -- cgit v1.2.3-70-g09d2