index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Xavier Chantry <shiningxc@gmail.com> | 2009-12-09 23:20:29 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-12-13 23:22:16 -0600 |
commit | a2c9cbdbdc8ca1ad1653fa42eb4b7571bfe744ec (patch) | |
tree | 159827aa7421c5e77be0b392a49a2d86ccb4916f | |
parent | b8b8c78627b2f1791a2b46b0d6c87d7a9b90f376 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 10 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 05555f2e..6bf9b4db 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -118,13 +118,14 @@ static int download_internal(const char *url, const char *localpath, filename = get_filename(url); if(!filename) { - return(-1); + _alpm_log(PM_LOG_ERROR, _("url '%s' is invalid\n"), url); + RET_ERR(PM_ERR_SERVER_BAD_URL, -1); } fileurl = fetchParseURL(url); if(!fileurl) { _alpm_log(PM_LOG_ERROR, _("url '%s' is invalid\n"), url); - RET_ERR(PM_ERR_SERVER_BAD_URL, -1); + RET_ERR(PM_ERR_LIBFETCH, -1); } destfile = get_destfile(localpath, filename); @@ -179,6 +180,9 @@ static int download_internal(const char *url, const char *localpath, * non-stat request, so avoid it. */ fetchLastErrCode = 0; if(fetchStat(fileurl, &ust, "") == -1) { + pm_errno = PM_ERR_LIBFETCH; + _alpm_log(PM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"), + filename, gethost(fileurl), fetchLastErrString); ret = -1; goto cleanup; } @@ -230,6 +234,7 @@ static int download_internal(const char *url, const char *localpath, dl_thisfile = 0; localf = fopen(tempfile, "wb"); if(localf == NULL) { /* still null? */ + pm_errno = PM_ERR_RETRIEVE; _alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"), tempfile, strerror(errno)); ret = -1; @@ -247,6 +252,7 @@ static int download_internal(const char *url, const char *localpath, size_t nwritten = 0; nwritten = fwrite(buffer, 1, nread, localf); if((nwritten != nread) || ferror(localf)) { + pm_errno = PM_ERR_RETRIEVE; _alpm_log(PM_LOG_ERROR, _("error writing to file '%s': %s\n"), tempfile, strerror(errno)); ret = -1; |