do not try to download an empty db list

Starting the download process, even if there is nothing to actually
download, causes an error when pacman is built without curl and has no
XferCommand defined (like our test suite).

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2021-01-15 23:21:01 -08:00 committed by Allan McRae
parent 79227dabe0
commit 1c4e079899

View file

@ -198,6 +198,10 @@ int SYMEXPORT alpm_db_update(alpm_handle_t *handle, alpm_list_t *dbs, int force)
payload->max_size = 128 * 1024 * 1024;
payloads = alpm_list_add(payloads, payload);
}
if(payloads == NULL) {
ret = 0;
goto cleanup;
}
event.type = ALPM_EVENT_DB_RETRIEVE_START;
EVENT(handle, &event);