scripts: add possibility to not override default connection timeout
authorCody Schafer <dev@codyps.com>
Fri May 09 19:07:02 2014 -0700 (2014-05-09)
changeset 3307d7eaba5831d5
parent 3306 80e46e644bc0
child 3308 b571b3566915
scripts: add possibility to not override default connection timeout

Allow '-1' to be specified as CONNECTION_TIMEOUT to disable the use
of the connection timeout for wget.

Signed-off-by: Cody P Schafer <dev@codyps.com>
Message-Id: <cb33f8c2cbaf802d4f04.1399687632@localhost>
Patchwork-Id: 347582
config/global/download.in
scripts/functions
     1.1 --- a/config/global/download.in	Wed May 07 18:40:48 2014 +0200
     1.2 +++ b/config/global/download.in	Fri May 09 19:07:02 2014 -0700
     1.3 @@ -47,6 +47,8 @@
     1.4        
     1.5        Note that this value applies equally to wget if you have that installed.
     1.6  
     1.7 +      If '-1' is specified, no timeout reconfiguration options are passed to wget/curl.
     1.8 +
     1.9  config ONLY_DOWNLOAD
    1.10      bool
    1.11      prompt "Stop after downloading tarballs"
     2.1 --- a/scripts/functions	Wed May 07 18:40:48 2014 +0200
     2.2 +++ b/scripts/functions	Fri May 09 19:07:02 2014 -0700
     2.3 @@ -572,9 +572,14 @@
     2.4      # not easy to detect them, so force a global ${CT_CONNECT_TIMEOUT}-second
     2.5      # timeout.
     2.6      # For curl, no good progress indicator is available. So, be silent.
     2.7 +    if [ ${CT_CONNECT_TIMEOUT} = -1 ]; then
     2.8 +        T=
     2.9 +    else
    2.10 +        T="-T ${CT_CONNECT_TIMEOUT}"
    2.11 +    fi
    2.12      if CT_DoExecLog ALL wget --passive-ftp --tries=3 -nc    \
    2.13                               --progress=dot:binary          \
    2.14 -                             -T ${CT_CONNECT_TIMEOUT}       \
    2.15 +                             ${T}                           \
    2.16                               -O "${tmp}"                    \
    2.17                               "${url}"
    2.18      then