summaryrefslogtreecommitdiff
path: root/lib/libalpm/error.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-04-06 21:00:11 -0500
committerDan McGee <dan@archlinux.org>2008-04-06 21:00:11 -0500
commita708c6eadc107475015eb2fbe2c7ec5d00bc0099 (patch)
treeaea2f624e4eb92554b041f355862c44662cfb10e /lib/libalpm/error.c
parent9c7ebe68724791f06cdde2febdf91f0472f18407 (diff)
downloadpacman-a708c6eadc107475015eb2fbe2c7ec5d00bc0099.tar.xz
Allow disabling of internal (libdownload) code
Add a new --disable-internal-download flag to configure allowing the internal download code to be skipped. This will be helpful on platforms that currently don't support either libdownload or libfetch (such as Cygwin) and for just compiling a lighter weight pacman binary. This was made really easy by our recent refactoring of the download code into separate internal and external functions, as well as some error code cleanup. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/error.c')
-rw-r--r--lib/libalpm/error.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index 49eca544..30e9cf86 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -19,7 +19,9 @@
#include "config.h"
+#if defined(INTERNAL_DOWNLOAD)
#include <download.h> /* downloadLastErrString */
+#endif
/* libalpm */
#include "util.h"
@@ -132,9 +134,6 @@ const char SYMEXPORT *alpm_strerror(int err)
return _("not confirmed");
case PM_ERR_INVALID_REGEX:
return _("invalid regular expression");
- /* Downloading */
- case PM_ERR_CONNECT_FAILED:
- return _("connection to remote host failed");
/* Errors from external libraries- our own wrapper error */
case PM_ERR_LIBARCHIVE:
/* it would be nice to use archive_error_string() here, but that
@@ -142,7 +141,14 @@ const char SYMEXPORT *alpm_strerror(int err)
* error string instead. */
return _("libarchive error");
case PM_ERR_LIBDOWNLOAD:
+#if defined(INTERNAL_DOWNLOAD)
return downloadLastErrString;
+#else
+ /* obviously shouldn't get here... */
+ return _("libdownload error");
+#endif
+ case PM_ERR_EXTERNAL_DOWNLOAD:
+ return _("error invoking external downloader");
/* Unknown error! */
default:
return _("unexpected error");