From 01cc55a1f47c99d3f296e710904b5f3fc31e0b1d Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Fri, 10 Jan 2014 16:25:16 +0100 Subject: Add events ALPM_EVENT_RETRIEVE_{DONE, FAILED} To go along with RETRIEVE_START, one other event will be emmitted once the downloads are done: RETRIEVE_DONE if all files were successfully downloaded, else RETRIEVE_FAILED. Signed-off-by: Olivier Brunel Signed-off-by: Allan McRae --- lib/libalpm/sync.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 076935d1..68c33243 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -977,12 +977,15 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) event.type = ALPM_EVENT_RETRIEVE_START; EVENT(handle, &event); + event.type = ALPM_EVENT_RETRIEVE_DONE; for(i = files; i; i = i->next) { if(download_single_file(handle, i->data, cachedir) == -1) { errors++; + event.type = ALPM_EVENT_RETRIEVE_FAILED; _alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files\n")); } } + EVENT(handle, &event); } finish: -- cgit v1.2.3-24-g4f1b