From 77436f025f7e0b494a81d257fb8d7ce62858c3be Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Fri, 9 Sep 2011 15:48:59 +0200 Subject: scripts/functions: only use passive FTP Virtually all FTP server available on-line support passive FTP. At least, this is the case for the servers crosstool-NG needs to connect to. Signed-off-by: "Yann E. MORIN" diff --git a/scripts/functions b/scripts/functions index eb245bd..bd74634 100644 --- a/scripts/functions +++ b/scripts/functions @@ -448,8 +448,6 @@ CT_DoGetFile() { # Remove potential left-over from a previous run rm -f "${tmp}" - # Some (very old!) FTP server might not support the passive mode, thus - # retry without. # We also retry a few times, in case there is a transient error (eg. behind # a dynamic IP that changes during the transfer...) # With automated download as we are doing, it can be very dangerous to @@ -459,10 +457,14 @@ CT_DoGetFile() { # 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}" \ - ; then - # One of them succeeded, good! + if CT_DoExecLog ALL curl --ftp-pasv \ + --retry 3 \ + --connect-timeout ${CT_CONNECT_TIMEOUT} \ + --location --fail --silent \ + --output "${tmp}" \ + "${url}" + then + # Success, we got it, good! mv "${tmp}" "${dest}" else # Woops... -- cgit v0.10.2-6-g49f6