[pacman-dev] [PATCH] Do not download files if find_dl_candidates() fails

Anatol Pomozov anatol.pomozov at gmail.com
Wed Mar 4 21:25:32 UTC 2020


One reason why the function returns an error is some repo
does not have any servers.

Signed-off-by: Anatol Pomozov <anatol.pomozov at gmail.com>
---
 lib/libalpm/sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 89cc7867..50b21b54 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -787,7 +787,7 @@ static int download_files(alpm_handle_t *handle)
 
 	errors += find_dl_candidates(handle, &files);
 
-	if(files) {
+	if(files && !errors) {
 		/* check for necessary disk space for download */
 		if(handle->checkspace) {
 			off_t *file_sizes;
-- 
2.25.1


More information about the pacman-dev mailing list