From 75bfe825fc4018173b0d7a3c4029094edb52d93a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 15 Dec 2010 19:57:31 -0500 Subject: add curl to alpm initialization and teardown routines Signed-off-by: Dave Reisner --- lib/libalpm/error.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libalpm/error.c') diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index 21fbb48f..aec97a1f 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -28,6 +28,10 @@ #include /* MAXHOSTNAMELEN */ #endif +#ifdef HAVE_LIBCURL +#include +#endif + #ifdef HAVE_LIBFETCH #include /* fetchLastErrString */ #endif -- cgit v1.2.3-24-g4f1b From 8a58648471e3a5311529955cd91c1a082be10056 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 15 Jan 2011 15:38:16 -0500 Subject: handle error case for PM_ERR_LIBCURL Add PM_ERR_LIBCURL to error enum and handle case in error.c by returning curl_easy_strerror() based on the error number carried by the gloabl alpm handle. Signed-off-by: Dave Reisner --- lib/libalpm/error.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/libalpm/error.c') diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index aec97a1f..19c7d92c 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -39,6 +39,7 @@ /* libalpm */ #include "util.h" #include "alpm.h" +#include "handle.h" const char SYMEXPORT *alpm_strerrorlast(void) { @@ -157,6 +158,13 @@ const char SYMEXPORT *alpm_strerror(int err) #else /* obviously shouldn't get here... */ return _("download library error"); +#endif + case PM_ERR_LIBCURL: +#ifdef HAVE_LIBCURL + return(curl_easy_strerror(handle->curlerr)); +#else + /* obviously shouldn't get here... */ + return _("download library error"); #endif case PM_ERR_EXTERNAL_DOWNLOAD: return _("error invoking external downloader"); -- cgit v1.2.3-24-g4f1b From f2eac18a6ec62db3ec53744064e05416024c1b30 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 8 Feb 2011 21:05:53 -0500 Subject: Remove all traces of libfetch Signed-off-by: Dave Reisner --- lib/libalpm/error.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'lib/libalpm/error.c') diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index 19c7d92c..cf98cc75 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -20,22 +20,10 @@ #include "config.h" -/* TODO: needed for the libfetch stuff, unfortunately- we should kill it */ -#include -/* the following two are needed for FreeBSD's libfetch */ -#include /* PATH_MAX */ -#if defined(HAVE_SYS_PARAM_H) -#include /* MAXHOSTNAMELEN */ -#endif - #ifdef HAVE_LIBCURL #include #endif -#ifdef HAVE_LIBFETCH -#include /* fetchLastErrString */ -#endif - /* libalpm */ #include "util.h" #include "alpm.h" @@ -152,13 +140,6 @@ const char SYMEXPORT *alpm_strerror(int err) * requires the archive struct, so we can't. Just use a generic * error string instead. */ return _("libarchive error"); - case PM_ERR_LIBFETCH: -#ifdef HAVE_LIBFETCH - return fetchLastErrString; -#else - /* obviously shouldn't get here... */ - return _("download library error"); -#endif case PM_ERR_LIBCURL: #ifdef HAVE_LIBCURL return(curl_easy_strerror(handle->curlerr)); -- cgit v1.2.3-24-g4f1b