[pacman-dev] [PATCH 1/1] dload: use 'partial file' instead of 'filesize exceeded' message

Christian Hesse list at eworm.de
Thu Oct 9 08:10:19 UTC 2014


From: Christian Hesse <mail at eworm.de>

If the server has a package file that is too big (does not match the
recorded file size in repository db file) pacman fails with a 'filesize
exceeded' message. This is misleading as it looks like pacman is
suffering a local problem, for example ulimit on filesize or the like.

This changes the message to 'partial file', which describes the problem
a lot better IMHO.
---
 lib/libalpm/dload.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 01fe57e..c819d73 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -491,14 +491,14 @@ static int curl_download_internal(struct dload_payload *payload,
 		case CURLE_ABORTED_BY_CALLBACK:
 			/* handle the interrupt accordingly */
 			if(dload_interrupted == ABORT_OVER_MAXFILESIZE) {
-				payload->curlerr = CURLE_FILESIZE_EXCEEDED;
+				payload->curlerr = CURLE_PARTIAL_FILE;
 				payload->unlink_on_fail = 1;
 				handle->pm_errno = ALPM_ERR_LIBCURL;
-				/* use the 'size exceeded' message from libcurl */
+				/* use the 'partial file' message from libcurl */
 				_alpm_log(handle, ALPM_LOG_ERROR,
 						_("failed retrieving file '%s' from %s : %s\n"),
 						payload->remote_name, hostname,
-						curl_easy_strerror(CURLE_FILESIZE_EXCEEDED));
+						curl_easy_strerror(CURLE_PARTIAL_FILE));
 			}
 			goto cleanup;
 		default:
-- 
2.1.2


More information about the pacman-dev mailing list