On 09/10/14 18:10, Christian Hesse wrote:
From: Christian Hesse <mail@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.
I don't agree with this change. If anything, I think the error message should be clarified by not relying on the curl string. Maybe: _alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : expected download size exceeded\n"), Allan
--- 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: