index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <d@falconindy.com> | 2011-02-02 23:21:43 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2011-03-09 15:22:32 -0500 |
commit | 4ad4527d104c915efa912d3e1e3a543fad7aca34 (patch) | |
tree | 63a1c870a6ad0a3006e1f0998668052d8edfca43 /lib | |
parent | 96e458b705eda4ddff7d6ec890cf1daf898e9186 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 16 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 22fee543..51dda5e2 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -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 |