log and set errno when failing to rename download

This commit is contained in:
morganamilo 2024-08-27 22:41:21 +01:00
parent 6ba5c20e76
commit d1b66cf4be
No known key found for this signature in database
GPG key ID: E48D0A8326DE47C5

View file

@ -1114,6 +1114,8 @@ static int finalize_download_locations(alpm_list_t *payloads, const char *localp
if(ret == -1) {
/* ignore error if the file already existed - only signature file was downloaded */
if(payload->mtime_existing_file == 0) {
_alpm_log(payload->handle, ALPM_LOG_ERROR, _("could not move %s into %s (%s)\n"),
payload->destfile_name, localpath, strerror(errno));
returnvalue = -1;
}
}
@ -1265,7 +1267,7 @@ download_signature:
}
if (finalize_download_locations(payloads, localpath) != 0 && ret == 0) {
return -1;
RET_ERR(handle, ALPM_ERR_RETRIEVE, -1);
}
return ret;
}