Remove a bit more download.h pollution
Kill it where it isn't absolutely necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
4c872594da
commit
9c7ebe6872
|
@ -33,7 +33,6 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <download.h> /* downloadLastErrString among others. kill this */
|
|
||||||
|
|
||||||
/* libalpm */
|
/* libalpm */
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
|
@ -254,12 +253,9 @@ int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
|
||||||
pm_errno = 0;
|
pm_errno = 0;
|
||||||
return(1);
|
return(1);
|
||||||
} else if(ret == -1) {
|
} else if(ret == -1) {
|
||||||
/* we use downloadLastErrString and downloadLastErrCode here,
|
/* pm_errno was set by the download code */
|
||||||
* error returns from libdownload */
|
_alpm_log(PM_LOG_DEBUG, "failed to sync db: %s\n", alpm_strerrorlast());
|
||||||
/* TODO we may not have used libdownload, this should change */
|
return(-1);
|
||||||
_alpm_log(PM_LOG_DEBUG, "failed to sync db: %s [%d]\n",
|
|
||||||
downloadLastErrString, downloadLastErrCode);
|
|
||||||
RET_ERR(PM_ERR_DB_SYNC, -1);
|
|
||||||
} else {
|
} else {
|
||||||
/* form the path to the db location */
|
/* form the path to the db location */
|
||||||
snprintf(path, PATH_MAX, "%s%s" DBEXT, dbpath, db->treename);
|
snprintf(path, PATH_MAX, "%s%s" DBEXT, dbpath, db->treename);
|
||||||
|
|
|
@ -136,6 +136,7 @@ static int download_internal(const char *url, const char *localpath,
|
||||||
if(strcmp(SCHEME_FILE, fileurl->scheme) != 0) {
|
if(strcmp(SCHEME_FILE, fileurl->scheme) != 0) {
|
||||||
host = fileurl->host;
|
host = fileurl->host;
|
||||||
}
|
}
|
||||||
|
pm_errno = PM_ERR_LIBDOWNLOAD;
|
||||||
_alpm_log(PM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"),
|
_alpm_log(PM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"),
|
||||||
filename, host, downloadLastErrString);
|
filename, host, downloadLastErrString);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -183,6 +184,7 @@ static int download_internal(const char *url, const char *localpath,
|
||||||
char buffer[PM_DLBUF_LEN];
|
char buffer[PM_DLBUF_LEN];
|
||||||
while((nread = fread(buffer, 1, PM_DLBUF_LEN, dlf)) > 0) {
|
while((nread = fread(buffer, 1, PM_DLBUF_LEN, dlf)) > 0) {
|
||||||
if(ferror(dlf)) {
|
if(ferror(dlf)) {
|
||||||
|
pm_errno = PM_ERR_LIBDOWNLOAD;
|
||||||
_alpm_log(PM_LOG_ERROR, _("error downloading '%s': %s\n"),
|
_alpm_log(PM_LOG_ERROR, _("error downloading '%s': %s\n"),
|
||||||
filename, downloadLastErrString);
|
filename, downloadLastErrString);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
Loading…
Reference in New Issue