summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-06-02 21:56:13 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-06-02 21:56:13 (GMT)
commit3299aa76858f8380d8ddf69492e3f2d874d7cad1 (patch)
treedc505a7902932052d73705aefb9ffd7b28259d7b /scripts
parent08ebd6ec3db26f34ea4fcb04fc475aec5e26ad73 (diff)
functions: fix downloading files
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/functions b/scripts/functions
index eca66b8..5712631 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -426,7 +426,8 @@ CT_GetFileExtension() {
# 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 @@ CT_DoGetFile() {
# 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}"