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
This commit is contained in:
Cody Schafer 2014-05-09 19:07:02 -07:00
parent 5fb6e6ddf8
commit 490ec21217
2 changed files with 8 additions and 1 deletions

View File

@ -47,6 +47,8 @@ config CONNECT_TIMEOUT
Note that this value applies equally to wget if you have that installed. Note that this value applies equally to wget if you have that installed.
If '-1' is specified, no timeout reconfiguration options are passed to wget/curl.
config ONLY_DOWNLOAD config ONLY_DOWNLOAD
bool bool
prompt "Stop after downloading tarballs" prompt "Stop after downloading tarballs"

View File

@ -572,9 +572,14 @@ CT_DoGetFile() {
# not easy to detect them, so force a global ${CT_CONNECT_TIMEOUT}-second # not easy to detect them, so force a global ${CT_CONNECT_TIMEOUT}-second
# timeout. # timeout.
# For curl, no good progress indicator is available. So, be silent. # For curl, no good progress indicator is available. So, be silent.
if [ ${CT_CONNECT_TIMEOUT} = -1 ]; then
T=
else
T="-T ${CT_CONNECT_TIMEOUT}"
fi
if CT_DoExecLog ALL wget --passive-ftp --tries=3 -nc \ if CT_DoExecLog ALL wget --passive-ftp --tries=3 -nc \
--progress=dot:binary \ --progress=dot:binary \
-T ${CT_CONNECT_TIMEOUT} \ ${T} \
-O "${tmp}" \ -O "${tmp}" \
"${url}" "${url}"
then then