Fix error when downloading signature file for an existing package file

If a package was already downloaded but its signature file was not,
pacman would download the signature then error out despite all files
being present.

Also fixes a similar error when some, but not all, package databases
were updated with -Sy.

Fixes #156

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2024-06-19 17:31:54 +10:00
parent b60b779fc8
commit c9acfc2b50

View file

@ -1108,7 +1108,10 @@ static int finalize_download_locations(alpm_list_t *payloads, const char *localp
int ret = move_file(payload->destfile_name, localpath); int ret = move_file(payload->destfile_name, localpath);
if(ret == -1) { if(ret == -1) {
returnvalue = -1; /* ignore error if the file already existed - only signature file was downloaded */
if(payload->mtime_existing_file == 0) {
returnvalue = -1;
}
} }
if (payload->download_signature) { if (payload->download_signature) {