scrips/functions: fix downloads using curl
authorRichard Strand <richard.strand@icomera.com>
Sun Jan 10 15:19:25 2010 +0000 (2010-01-10)
changeset 17203995b34ba925
parent 1719 5c0d326c2cea
child 1725 dbd5078816f9
scrips/functions: fix downloads using curl

By default curl doesn't folow redirects. This breaks sourceforge downloads.
Add the -L option to curl to fix this.

Curl also downloads the html as a file even when it gets a 404. This breaks
http downloads when using the failback system. Add the -f option to curl to fix
this.

Signed-off-by: Richard Strand <richard.strand@icomera.com>
scripts/functions
     1.1 --- a/scripts/functions	Sat Jan 09 16:05:01 2010 +0100
     1.2 +++ b/scripts/functions	Sun Jan 10 15:19:25 2010 +0000
     1.3 @@ -343,8 +343,8 @@
     1.4      # Note: comments about wget method (above) are also valid here
     1.5      # Plus: no good progress indicator is available with curl,
     1.6      #       so, be silent.
     1.7 -    CT_DoExecLog ALL curl -s --ftp-pasv -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT}    \
     1.8 -    || CT_DoExecLog ALL curl -s -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT}            \
     1.9 +    CT_DoExecLog ALL curl -s --ftp-pasv -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f  \
    1.10 +    || CT_DoExecLog ALL curl -s -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f          \
    1.11      || true
    1.12  }
    1.13