scripts/crosstool.sh
changeset 444 de5067d2fa4f
parent 441 f1326505e3e5
child 450 4765aa0bd896
     1.1 --- a/scripts/crosstool.sh	Sun Apr 13 22:46:02 2008 +0000
     1.2 +++ b/scripts/crosstool.sh	Thu Apr 17 19:21:32 2008 +0000
     1.3 @@ -206,6 +206,37 @@
     1.4          ;;
     1.5  esac
     1.6  
     1.7 +# Set environment for proxy access
     1.8 +# This has to be done even if we are restarting, as they don't get
     1.9 +# saved in the step snapshot.
    1.10 +case "${CT_PROXY_TYPE}" in
    1.11 +  none) ;;
    1.12 +  http)
    1.13 +    http_proxy="http://"
    1.14 +    case  "${CT_PROXY_USER}:${CT_PROXY_PASS}" in
    1.15 +      :)      ;;
    1.16 +      :*)     http_proxy="${http_proxy}:${CT_HTP_PROXY_PASS}@";;
    1.17 +      *:)     http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}@";;
    1.18 +      *:*)    http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}:${CT_HTP_PROXY_PASS}@";;
    1.19 +    esac
    1.20 +    export http_proxy="${http_proxy}${HTTP_PROXY_HOST}:${HTTP_PROXY_PORT}/"
    1.21 +    export https_proxy="${http_proxy}"
    1.22 +    export ftp_proxy="${http_proxy}"
    1.23 +    ;;
    1.24 +  socks?)
    1.25 +    # Re;ove any lingering config file from any previous run
    1.26 +    rm -f "${CT_BUILD_DIR}/tsocks.conf"
    1.27 +    ( echo "server=${CT_PROXY_HOST}";
    1.28 +      echo "server_port=${CT_PROXY_PORT}";
    1.29 +      echo "server_type=${CT_PROXY_TYPE#socks}";
    1.30 +      [ -n "${CT_PROXY_USER}"   ] && echo "default_user=${CT_PROXY_USER}";
    1.31 +      [ -n "${CT_PROXY_PASS}" ] && echo "default_pass=${CT_PROXY_PASS}";
    1.32 +    ) >"${CT_BUILD_DIR}/tsocks.conf"
    1.33 +    export TSOCKS_CONF_FILE="${CT_BUILD_DIR}/tsocks.conf"
    1.34 +    . tsocks -on
    1.35 +    ;;
    1.36 +esac
    1.37 +
    1.38  # Setting up the rest of the environment only if not restarting
    1.39  if [ -z "${CT_RESTART}" ]; then
    1.40      # Determine build system if not set by the user
    1.41 @@ -307,20 +338,6 @@
    1.42      [ ${CT_PARALLEL_JOBS} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -j${CT_PARALLEL_JOBS}"
    1.43      [ ${CT_LOAD} -ne 0 ] && PARALLELMFLAGS="${PARALLELMFLAGS} -l${CT_LOAD}"
    1.44  
    1.45 -    # Set environment for proxy access
    1.46 -    if [ "${CT_USE_HTTP_PROXY}" = "y" ]; then
    1.47 -      http_proxy="http://"
    1.48 -      case  "${CT_HTTP_PROXY_USER}:${CT_HTTP_PROXY_PASSWD}" in
    1.49 -        :)      ;;
    1.50 -        :*)     http_proxy="${http_proxy}:${CT_HTP_PROXY_PASSWD}@";;
    1.51 -        *:)     http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}@";;
    1.52 -        *:*)    http_proxy="${http_proxy}${CT_HTTP_PROXY_USER}:${CT_HTP_PROXY_PASSWD}@";;
    1.53 -      esac
    1.54 -      export http_proxy="${http_proxy}${HTTP_PROXY_HOST}:${HTTP_PROXY_PORT}/"
    1.55 -      export https_proxy="${http_proxy}"
    1.56 -      export ftp_proxy="${http_proxy}"
    1.57 -    fi
    1.58 -
    1.59      CT_DoStep EXTRA "Dumping internal crosstool-NG configuration"
    1.60      CT_DoLog EXTRA "Building a toolchain for:"
    1.61      CT_DoLog EXTRA "  build  = ${CT_BUILD}"