mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-03 02:41:53 -05:00
Fix libfetch configure checking
I don't know what I tested in commit 3e7b90ff6950, but it definitely wasn't working as advertised. Fix the checks in the source code itself to match the right define (HAVE_LIBFETCH), as well as make sure the configure check defaults to looking for the library but not bailing if it could not be found. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
881bf5c90f
commit
fe788ee4a6
@ -150,7 +150,7 @@ AM_CONDITIONAL([HAVE_LIBSSL], [test "x$ac_cv_lib_ssl_MD5_Final" = "xyes"])
|
|||||||
|
|
||||||
# Enable or disable usage of libfetch
|
# Enable or disable usage of libfetch
|
||||||
AC_MSG_CHECKING(whether to link with libfetch)
|
AC_MSG_CHECKING(whether to link with libfetch)
|
||||||
AS_IF([test "x$with_fetch" = "xyes"],
|
AS_IF([test "x$with_fetch" != "xno"],
|
||||||
[AC_MSG_RESULT(yes)
|
[AC_MSG_RESULT(yes)
|
||||||
AC_CHECK_LIB([fetch], [fetchParseURL], ,
|
AC_CHECK_LIB([fetch], [fetchParseURL], ,
|
||||||
[if test "x$with_fetch" != "xcheck"; then
|
[if test "x$with_fetch" != "xcheck"; then
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
/* connection caching setup */
|
/* connection caching setup */
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
#include <fetch.h>
|
#include <fetch.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ int SYMEXPORT alpm_initialize(void)
|
|||||||
bindtextdomain("libalpm", LOCALEDIR);
|
bindtextdomain("libalpm", LOCALEDIR);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
fetchConnectionCacheInit(5, 1);
|
fetchConnectionCacheInit(5, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ int SYMEXPORT alpm_release(void)
|
|||||||
_alpm_handle_free(handle);
|
_alpm_handle_free(handle);
|
||||||
handle = NULL;
|
handle = NULL;
|
||||||
|
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
fetchConnectionCacheClose();
|
fetchConnectionCacheClose();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <sys/param.h> /* MAXHOSTNAMELEN */
|
#include <sys/param.h> /* MAXHOSTNAMELEN */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
#include <fetch.h>
|
#include <fetch.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ static char *get_filename(const char *url) {
|
|||||||
return(filename);
|
return(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
static char *get_destfile(const char *path, const char *filename) {
|
static char *get_destfile(const char *path, const char *filename) {
|
||||||
char *destfile;
|
char *destfile;
|
||||||
/* len = localpath len + filename len + null */
|
/* len = localpath len + filename len + null */
|
||||||
@ -338,7 +338,7 @@ cleanup:
|
|||||||
static int download(const char *url, const char *localpath,
|
static int download(const char *url, const char *localpath,
|
||||||
int force) {
|
int force) {
|
||||||
if(handle->fetchcb == NULL) {
|
if(handle->fetchcb == NULL) {
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
return(download_internal(url, localpath, force));
|
return(download_internal(url, localpath, force));
|
||||||
#else
|
#else
|
||||||
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
|
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <sys/param.h> /* MAXHOSTNAMELEN */
|
#include <sys/param.h> /* MAXHOSTNAMELEN */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
#include <fetch.h> /* fetchLastErrString */
|
#include <fetch.h> /* fetchLastErrString */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ const char SYMEXPORT *alpm_strerror(int err)
|
|||||||
* error string instead. */
|
* error string instead. */
|
||||||
return _("libarchive error");
|
return _("libarchive error");
|
||||||
case PM_ERR_LIBFETCH:
|
case PM_ERR_LIBFETCH:
|
||||||
#ifdef HAVE_FETCH
|
#ifdef HAVE_LIBFETCH
|
||||||
return fetchLastErrString;
|
return fetchLastErrString;
|
||||||
#else
|
#else
|
||||||
/* obviously shouldn't get here... */
|
/* obviously shouldn't get here... */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user