# HG changeset patch # User "Yann E. MORIN" # Date 1307051773 -7200 # Node ID 5f2d85ceb4233976d09608f759cceaf2451399e1 # Parent ba1e71fa72a99f5714022767d0276d6df9719f26 functions: fix downloading files Signed-off-by: "Yann E. MORIN" diff -r ba1e71fa72a9 -r 5f2d85ceb423 scripts/functions --- a/scripts/functions Thu Jun 02 19:50:12 2011 +0200 +++ b/scripts/functions Thu Jun 02 23:56:13 2011 +0200 @@ -426,7 +426,8 @@ # to find the requested URL (think about snapshots, different layouts # for different gcc versions, etc...). CT_DoGetFile() { - local dest="${1}" + 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. @@ -449,10 +450,10 @@ # not easy to detect them, and wget does not timeout by default while # connecting, 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}" "$1" \ - || CT_DoExecLog ALL "${_curl}" --retry 3 --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f -s -o "${tmp}" "$1" \ - || CT_DoExecLog ALL "${_wget}" --passive-ftp --tries=3 -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary -O "${tmp}" "$1" \ - || CT_DoExecLog ALL "${_wget}" --tries=3 -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary -O "${tmp}" "$1" \ + 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}" \ ; then # One of them succeeded, good! mv "${tmp}" "${dest}"