# HG changeset patch # User "Yann E. MORIN" # Date 1216245432 0 # Node ID 889b448303aecb286367e370838dfa5d0301a8c3 # Parent 7abb354d457037c831637bc54d0765316d822bd9 Move the check for tsocks' availability just before using tsocks: make it clear we check before we use. Use CT_DoExecLog to validate tsocks configuration. Don't use gawk, but awk. awk *is* GNU awk, check by ./configure. /trunk/scripts/crosstool.sh | 9 5 4 0 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff -r 7abb354d4570 -r 889b448303ae scripts/crosstool.sh --- a/scripts/crosstool.sh Tue Jul 15 17:47:51 2008 +0000 +++ b/scripts/crosstool.sh Wed Jul 16 21:57:12 2008 +0000 @@ -235,13 +235,12 @@ CT_DoLog DEBUG "http_proxy='${http_proxy}'" ;; sockssys) - CT_HasOrAbort tsocks # Force not using HTTP proxy unset http_proxy ftp_proxy https_proxy + CT_HasOrAbort tsocks . tsocks -on ;; socks*) - CT_HasOrAbort tsocks # Force not using HTTP proxy unset http_proxy ftp_proxy https_proxy # Remove any lingering config file from any previous run @@ -249,7 +248,7 @@ # Find all interfaces and build locally accessible networks server_ip=$(ping -c 1 -W 2 "${CT_PROXY_HOST}" |head -n 1 |sed -r -e 's/^[^\(]+\(([^\)]+)\).*$/\1/;' || true) CT_TestOrAbort "SOCKS proxy '${CT_PROXY_HOST}' has no IP." -n "${server_ip}" - /sbin/ifconfig |gawk -v server_ip="${server_ip}" ' + /sbin/ifconfig |awk -v server_ip="${server_ip}" ' BEGIN { split( server_ip, tmp, "\\." ); server_ip_num = tmp[1] * 2^24 + tmp[2] * 2^16 + tmp[3] * 2^8 + tmp[4] * 2^0; @@ -308,7 +307,9 @@ ;; esac echo "server_type = ${proxy_type}" >> "${CT_BUILD_DIR}/tsocks.conf" - validateconf -f "${CT_BUILD_DIR}/tsocks.conf" 2>&1 |CT_DoLog DEBUG + CT_HasOrAbort tsocks + # If tsocks was found, then validateconf is present (distributed with tsocks). + CT_DoExecLog DEBUG validateconf -f "${CT_BUILD_DIR}/tsocks.conf" export TSOCKS_CONF_FILE="${CT_BUILD_DIR}/tsocks.conf" . tsocks -on ;;