summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2021-01-16 08:21:01 +0100
committerAllan McRae <allan@archlinux.org>2021-01-19 03:39:37 +0100
commit1c4e07989940a435483563be7c12915b32289fbe (patch)
tree2c4ce932e5fb45034fc3b8e1209ba3d63203e13f /lib
parent79227dabe07c43b5a208696312a42b00a328398d (diff)
downloadpacman-1c4e07989940a435483563be7c12915b32289fbe.tar.gz
pacman-1c4e07989940a435483563be7c12915b32289fbe.tar.xz
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_sync.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 0a5cb7c2..91e5f5cf 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -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);