# HG changeset patch # User "Yann E. MORIN" # Date 1236940493 0 # Node ID ded91847b3b52eadde60f26e72be2e4c16f7e817 # Parent acf1944ef6a4081e1736bae68156b923b7e6bc4d Correctly use CT_DoExecLog with wget and curl. /trunk/scripts/functions | 16 8 8 0 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff -r acf1944ef6a4 -r ded91847b3b5 scripts/functions --- a/scripts/functions Wed Mar 11 20:56:27 2009 +0000 +++ b/scripts/functions Fri Mar 13 10:34:53 2009 +0000 @@ -112,7 +112,7 @@ } # Execute an action, and log its messages -# Usage: CT_DoExecLog <[VAR=val...] command [parameters...]> +# Usage: [VAR=val...] CT_DoExecLog CT_DoExecLog() { local level="$1" shift @@ -399,8 +399,8 @@ # Some company networks have firewalls to connect to the internet, but it's # not easy to detect them, and wget does not timeout by default while # connecting, so force a global ${CT_CONNECT_TIMEOUT}-second timeout. - wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 --passive-ftp "$1" \ - || wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 "$1" \ + CT_DoExecLog ALL wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 --passive-ftp "$1" \ + || CT_DoExecLog ALL wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 "$1" \ || true } @@ -409,9 +409,9 @@ CT_DoGetFileCurl() { # Note: comments about wget method (above) are also valid here # Plus: no good progress indicator is available with curl, - # so output is consigned to oblivion - curl --ftp-pasv -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} >/dev/null \ - || curl -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} >/dev/null \ + # so, be silent. + CT_DoExecLog ALL curl -s --ftp-pasv -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} \ + || CT_DoExecLog ALL curl -s -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} \ || true } @@ -422,8 +422,8 @@ CT_DoGetFile() { case "${_wget},${_curl}" in ,) CT_Abort "Could find neither wget nor curl";; - ,*) CT_DoExecLog ALL CT_DoGetFileCurl "$1" 2>&1;; - *) CT_DoExecLog ALL CT_DoGetFileWget "$1" 2>&1;; + ,*) CT_DoGetFileCurl "$1";; + *) CT_DoGetFileWget "$1";; esac }