dload: unlink file on filesize exceeded error

On filesize exceeded error pacman leaves a .part file in cache dir,
resulting in this error on next try:

error: failed to commit transaction (wrong or NULL argument passed)
Errors occurred, no packages were upgraded.

Unlink the file on error to avoid this.
This commit is contained in:
Christian Hesse 2014-10-09 09:51:51 +02:00 committed by Allan McRae
parent 11dff8a50e
commit d8f395fb56
1 changed files with 1 additions and 0 deletions

View File

@ -494,6 +494,7 @@ static int curl_download_internal(struct dload_payload *payload,
/* handle the interrupt accordingly */
if(dload_interrupted == ABORT_OVER_MAXFILESIZE) {
payload->curlerr = CURLE_FILESIZE_EXCEEDED;
payload->unlink_on_fail = 1;
handle->pm_errno = ALPM_ERR_LIBCURL;
_alpm_log(handle, ALPM_LOG_ERROR,
_("failed retrieving file '%s' from %s : expected download size exceeded\n"),