1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

dload: temp patch to allow curl/fetch coexistance

this is just some debuggery to allow pacman to operate with both fetch
and curl at the same time. use the PACMANDL variable to control which
library is used.

Signed-off-by: Dave Reisner <d@falconindy.com>
This commit is contained in:
Dave Reisner 2011-02-02 23:21:43 -05:00
parent 96e458b705
commit 4ad4527d10

View File

@ -561,8 +561,22 @@ cleanup:
static int download(const char *url, const char *localpath,
int force) {
if(handle->fetchcb == NULL) {
#ifdef HAVE_LIBFETCH
#if defined(HAVE_LIBFETCH) && defined(HAVE_LIBCURL)
const char *pmdownloader = getenv("PACMANDL");
if(!pmdownloader || strcmp(pmdownloader, "curl") == 0) {
printf(">> using libcurl as internal downloader\n");
return(curl_download_internal(url, localpath, force));
} else if(strcmp(pmdownloader, "fetch") == 0) {
printf(">> using libfetch as internal downloader\n");
return(fetch_download_internal(url, localpath, force));
} else {
_alpm_log(PM_LOG_ERROR, "PACMANDL unset or invalid! Use `curl' or `fetch'\n");
return(-1);
}
#elif HAVE_LIBFETCH
return(fetch_download_internal(url, localpath, force));
#elif HAVE_LIBCURL
return(curl_download_internal(url, localpath, force));
#else
RET_ERR(PM_ERR_EXTERNAL_DOWNLOAD, -1);
#endif