From d8f395fb563d3988f8a3bed16808e6ac5ca56435 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 9 Oct 2014 09:51:51 +0200 Subject: 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. --- lib/libalpm/dload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 4fc2dcbb..43c15035 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -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"), -- cgit v1.2.3-70-g09d2