Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/dload.c21
-rw-r--r--lib/libalpm/error.c18
2 files changed, 35 insertions, 4 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 0977eea0..44acec70 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -24,8 +24,25 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#if defined(INTERNAL_DOWNLOAD)
-#include <download.h> /* libdownload */
+#include <limits.h>
+/* the following two are needed on BSD for libfetch */
+#if defined(HAVE_SYS_SYSLIMITS_H)
+#include <sys/syslimits.h> /* PATH_MAX */
+#endif
+#if defined(HAVE_SYS_PARAM_H)
+#include <sys/param.h> /* MAXHOSTNAMELEN */
+#endif
+
+#if defined(HAVE_LIBDOWNLOAD)
+#include <download.h>
+#elif defined(HAVE_LIBFETCH)
+#include <fetch.h>
+#define downloadFreeURL fetchFreeURL
+#define downloadLastErrCode fetchLastErrCode
+#define downloadLastErrString fetchLastErrString
+#define downloadParseURL fetchParseURL
+#define downloadTimeout fetchTimeout
+#define downloadXGet fetchXGet
#endif
/* libalpm */
diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c
index 30e9cf86..7c30cd09 100644
--- a/lib/libalpm/error.c
+++ b/lib/libalpm/error.c
@@ -19,8 +19,22 @@
#include "config.h"
-#if defined(INTERNAL_DOWNLOAD)
+/* TODO: needed for the libfetch stuff, unfortunately- we should kill it */
+#include <stdio.h>
+#include <limits.h>
+/* the following two are needed on BSD for libfetch */
+#if defined(HAVE_SYS_SYSLIMITS_H)
+#include <sys/syslimits.h> /* PATH_MAX */
+#endif
+#if defined(HAVE_SYS_PARAM_H)
+#include <sys/param.h> /* MAXHOSTNAMELEN */
+#endif
+
+#if defined(HAVE_LIBDOWNLOAD)
#include <download.h> /* downloadLastErrString */
+#elif defined(HAVE_LIBFETCH)
+#include <fetch.h> /* fetchLastErrString */
+#define downloadLastErrString fetchLastErrString
#endif
/* libalpm */
@@ -145,7 +159,7 @@ const char SYMEXPORT *alpm_strerror(int err)
return downloadLastErrString;
#else
/* obviously shouldn't get here... */
- return _("libdownload error");
+ return _("download library error");
#endif
case PM_ERR_EXTERNAL_DOWNLOAD:
return _("error invoking external downloader");