diff options
author | Anatol Pomozov <anatol.pomozov@gmail.com> | 2020-05-06 03:28:49 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2020-05-09 03:58:21 +0200 |
commit | 64c4669f579dc5ad8d05329abffbd752ad0ed8f2 (patch) | |
tree | de8625be678a7fe5414961a0c92134a27728ea8c /lib/libalpm/be_sync.c | |
parent | 6a331af27fe6dc7842725d067fd2fb4a1c60c139 (diff) | |
download | pacman-64c4669f579dc5ad8d05329abffbd752ad0ed8f2.tar.gz pacman-64c4669f579dc5ad8d05329abffbd752ad0ed8f2.tar.xz |
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 <anatol.pomozov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_sync.c')
-rw-r--r-- | lib/libalpm/be_sync.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index b4a94315..add1a576 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -308,6 +308,7 @@ int SYMEXPORT alpm_dbs_update(alpm_handle_t *handle, alpm_list_t *dbs, int force int ret = -1; mode_t oldmask; alpm_list_t *payloads = NULL; + alpm_event_t event; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -384,10 +385,16 @@ int SYMEXPORT alpm_dbs_update(alpm_handle_t *handle, alpm_list_t *dbs, int force } } + event.type = ALPM_EVENT_DB_RETRIEVE_START; + EVENT(handle, &event); ret = _alpm_multi_download(handle, payloads, syncpath); if(ret < 0) { + event.type = ALPM_EVENT_DB_RETRIEVE_FAILED; + EVENT(handle, &event); goto cleanup; } + event.type = ALPM_EVENT_DB_RETRIEVE_DONE; + EVENT(handle, &event); for(i = dbs; i; i = i->next) { alpm_db_t *db = i->data; |