diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-09-09 15:34:04 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-09-09 15:34:04 +0200 |
commit | 4b0155c24fb8c27aa19bbb9ab136d256e9efc2b3 (patch) | |
tree | 7700038360951d11229164a90b76763954241a1e | |
parent | b0ff20b25564b3557cc2f378e689359766f243b0 (diff) | |
download | crosstool-ng-4b0155c24fb8c27aa19bbb9ab136d256e9efc2b3.tar.gz crosstool-ng-4b0155c24fb8c27aa19bbb9ab136d256e9efc2b3.tar.bz2 crosstool-ng-4b0155c24fb8c27aa19bbb9ab136d256e9efc2b3.zip |
scripts/functions: only use one download program
Currently, we use either wget or curl, whichever is installed.
In case both are installed, both are used. This means that it
takes a while trying all extensions.
Remove use of wget, and use only curl.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | scripts/functions | 16 |
2 files changed, 5 insertions, 13 deletions
@@ -496,7 +496,7 @@ has_or_abort prog=libtoolize ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \ err="'libtoolize' 1.5.26 or above was not found" has_or_abort prog=stat -has_or_abort prog="curl wget" +has_or_abort prog="curl" has_or_abort prog=patch has_or_abort prog=tar has_or_abort prog=gzip diff --git a/scripts/functions b/scripts/functions index 9a4b186a..eb245bd0 100644 --- a/scripts/functions +++ b/scripts/functions @@ -444,12 +444,6 @@ CT_DoGetFile() { local url="${1}" local dest="${CT_TARBALLS_DIR}/${url##*/}" local tmp="${dest}.tmp-dl" - # OK, just look if we have them... - # We are sure at least one is available, ./configure checked for it. - local _curl=$(CT_Which curl) - local _wget=$(CT_Which wget) - _curl="${_curl:-false}" - _wget="${_wget:-false}" # Remove potential left-over from a previous run rm -f "${tmp}" @@ -462,13 +456,11 @@ CT_DoGetFile() { # continue the downloads. It's far better to simply overwrite the # destination file. # Some company networks have firewalls to connect to the internet, but it's - # not easy to detect them, and wget does not timeout by default while - # connecting, so force a global ${CT_CONNECT_TIMEOUT}-second timeout. + # not easy to detect them, so force a global ${CT_CONNECT_TIMEOUT}-second + # timeout. # For curl, no good progress indicator is available. So, be silent. - if CT_DoExecLog ALL "${_curl}" --ftp-pasv --retry 3 --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f -s -o "${tmp}" "${url}" \ - || CT_DoExecLog ALL "${_curl}" --retry 3 --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f -s -o "${tmp}" "${url}" \ - || CT_DoExecLog ALL "${_wget}" --passive-ftp --tries=3 -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary -O "${tmp}" "${url}" \ - || CT_DoExecLog ALL "${_wget}" --tries=3 -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary -O "${tmp}" "${url}" \ + if CT_DoExecLog ALL curl --ftp-pasv --retry 3 --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f -s -o "${tmp}" "${url}" \ + || CT_DoExecLog ALL curl --retry 3 --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f -s -o "${tmp}" "${url}" \ ; then # One of them succeeded, good! mv "${tmp}" "${dest}" |