summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-04-19 16:34:59 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-04-19 16:34:59 (GMT)
commit15e04fe2de0193f623e5635b4d513e1099728204 (patch)
tree9348e1216a146c03f028a53d9ddec0b64d5c3bf6
parent6511a7787fef4e09c57c582ec63dd69d35937f37 (diff)
Get rid of the proxy settings, once and for all.
They have nothing to do in here, just let the user configure his/her system appropriately. -------- diffstat follows -------- /trunk/scripts/build/libc/eglibc.sh | 1 0 1 0 - /trunk/scripts/functions | 100 0 100 0 ----------------------------- /trunk/config/global/download.in | 148 0 148 0 ------------------------------------------- 3 files changed, 249 deletions(-)
-rw-r--r--config/global/download.in148
-rw-r--r--scripts/build/libc/eglibc.sh1
-rw-r--r--scripts/functions100
3 files changed, 0 insertions, 249 deletions
diff --git a/config/global/download.in b/config/global/download.in
index a82cda8..f571632 100644
--- a/config/global/download.in
+++ b/config/global/download.in
@@ -27,151 +27,6 @@ config FORCE_DOWNLOAD
Usefull if you suspect a tarball to be damaged.
-menuconfig USE_PROXY
- bool
- prompt "Use a proxy"
- default n
- help
- Say 'Y' here if you need to use a proxy to connect to the internet.
-
- You can then choose between an HTTP or a SOCKS 4/5 proxy.
-
- **** NOTE ****
- The settings below may not cover all possible proxy configurations!
- You'd be better off setting proxy in the environment!
-
-if USE_PROXY
-
-choice
- bool
- prompt "Proxy type"
-
-config PROXY_TYPE_HTTP
- bool
- prompt "HTTP proxy"
- help
- Use an HTTP proxy to connect to to the internet.
- Only the http and ftp protocols will be tunneled through this
- proxy.
-
- Alternatively to setting this option, you can set and export the
- following variables in your environment:
- ftp_proxy=http://user:passwd@proxy.server:port/
- http_proxy=http://user:passwd@proxy.server:port/
- https_proxy=http://user:passwd@proxy.server:port/
-
-# Haha! Here is an interesting feature/bug of mconf!
-# The following config entries will be shown out-side the
-# choice menu!
-# To add a third entry in the choice menu, add it after the
-# if...endif conditional below, and so on for a fourth entry...
-if PROXY_TYPE_HTTP
-
-config PROXY_HOST
- string
- prompt "hostname/IP"
-
-config PROXY_PORT
- int
- prompt "port"
- default 8080
-
-config PROXY_USER
- string
- prompt "user name"
-
-config PROXY_PASS
- string
- prompt "password"
-
-endif # USE_HTTP_PROXY
-
-config PROXY_TYPE_SOCKS
- bool
- prompt "SOCKS 4/5 proxy"
- help
- Use a Socks 4/5 proxy to connect to the internet.
- All protocols can get tunneled through this kind of proxy (your
- proxy configuration may not allow all protocols, but chances are
- that protocols needed by crosstool-NG are allowed).
-
- Alternatively to setting this option, you can configure tsocks
- system-wide, and set and export the following variable in your
- environment:
- LD_PRELOAD=/path/to/your/tsocks-library.so
-
- This option makes use of the tsocks library. You will have to have tsocks
- installed on your system, of course.
-
- If you think you do not know what tsocks is, or how to configure it,
- chances are that you do not need to set this option.
-
-if PROXY_TYPE_SOCKS
-
-choice
- bool
- prompt "type"
- default PROXY_TYPE_SOCKS_SYS
-
-config PROXY_TYPE_SOCKS_SYS
- bool
- prompt "Use system settings"
- help
- Use that if tsocks is already configured on your system.
-
-config PROXY_TYPE_SOCKS_AUTO
- bool
- prompt "Auto"
- help
- crosstool-NG will attempt to guess what type of SOCKS version
- the proxy speaks.
-
-config PROXY_TYPE_SOCKS_4
- bool
- prompt "SOCKS 4"
-
-config PROXY_TYPE_SOCKS_5
- bool
- prompt "SOCKS 5"
-
-endchoice
-
-if ! PROXY_TYPE_SOCKS_SYS
-
-config PROXY_HOST
- string
- prompt "hostname/IP"
-
-config PROXY_PORT
- int
- prompt "port"
- default 1080
-
-config PROXY_USER
- string
- prompt "user name"
-
-config PROXY_PASS
- string
- prompt "password"
-
-endif # ! PROXY_TYPE_SOCKS_SYS
-
-endif # USE_SOCKS_PROXY
-
-endchoice
-
-endif # USE_PROXY
-
-config PROXY_TYPE
- string
- default "none" if ! USE_PROXY
- default "http" if PROXY_TYPE_HTTP
- default "sockssys" if PROXY_TYPE_SOCKS_SYS
- default "socksauto" if PROXY_TYPE_SOCKS_AUTO
- default "socks4" if PROXY_TYPE_SOCKS_4
- default "socks5" if PROXY_TYPE_SOCKS_5
-
menuconfig USE_MIRROR
bool
prompt "Use LAN mirror"
@@ -285,9 +140,6 @@ config CONNECT_TIMEOUT
fast, you can try to lower this value to jump more quickly to allowed URLs. YMMV.
Note that this value applies equally to wget if you have that installed.
-
- Of course, you'd be better off to use a proxy, as offered by the previous
- option.
config ONLY_DOWNLOAD
bool
diff --git a/scripts/build/libc/eglibc.sh b/scripts/build/libc/eglibc.sh
index 478a230..f36f4ec 100644
--- a/scripts/build/libc/eglibc.sh
+++ b/scripts/build/libc/eglibc.sh
@@ -14,7 +14,6 @@ do_eglibc_get() {
*) svn_action="export --force";;
esac
- CT_DoSetProxy ${CT_PROXY_TYPE}
CT_DoExecLog ALL svn ${svn_action} -r "${CT_EGLIBC_REVISION:-HEAD}" "${svn_url}" . 2>&1
# Compress eglibc
diff --git a/scripts/functions b/scripts/functions
index c56f5da..756f77d 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -288,103 +288,6 @@ CT_GetFileExtension() {
return 0
}
-# Set environment for proxy access
-# Usage: CT_DoSetProxy <proxy_type>
-# where proxy_type is one of 'http', 'sockssys', 'socks4' or 'socks5',
-# or empty (to not change proxy settings).
-CT_DoSetProxy() {
- case "${1}" in
- http)
- http_proxy="http://"
- case "${CT_PROXY_USER}:${CT_PROXY_PASS}" in
- :) ;;
- :*) http_proxy="${http_proxy}:${CT_PROXY_PASS}@";;
- *:) http_proxy="${http_proxy}${CT_PROXY_USER}@";;
- *:*) http_proxy="${http_proxy}${CT_PROXY_USER}:${CT_PROXY_PASS}@";;
- esac
- export http_proxy="${http_proxy}${CT_PROXY_HOST}:${CT_PROXY_PORT}/"
- export https_proxy="${http_proxy}"
- export ftp_proxy="${http_proxy}"
- CT_DoLog DEBUG "http_proxy='${http_proxy}'"
- ;;
- sockssys)
- CT_HasOrAbort tsocks
- . tsocks -on
- ;;
- socks*)
- # Remove any lingering config file from any previous run
- rm -f "${CT_BUILD_DIR}/tsocks.conf"
- # 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 |"${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;
- pairs = 0;
- }
-
- $0 ~ /^[[:space:]]*inet addr:/ {
- split( $2, tmp, ":|\\." );
- if( ( tmp[2] == 127 ) && ( tmp[3] == 0 ) && ( tmp[4] == 0 ) && ( tmp[5] == 1 ) ) {
- /* Skip 127.0.0.1, it'\''s taken care of by tsocks itself */
- next;
- }
- ip_num = tmp[2] * 2^24 + tmp[3] * 2^16 + tmp[4] * 2 ^8 + tmp[5] * 2^0;
- i = 32;
- do {
- i--;
- mask = 2^32 - 2^i;
- } while( (i!=0) && ( and( server_ip_num, mask ) == and( ip_num, mask ) ) );
- mask = and( 0xFFFFFFFF, lshift( mask, 1 ) );
- if( (i!=0) && (mask!=0) ) {
- masked_ip = and( ip_num, mask );
- for( i=0; i<pairs; i++ ) {
- if( ( masked_ip == ips[i] ) && ( mask == masks[i] ) ) {
- next;
- }
- }
- ips[pairs] = masked_ip;
- masks[pairs] = mask;
- pairs++;
- printf( "local = %d.%d.%d.%d/%d.%d.%d.%d\n",
- and( 0xFF, masked_ip / 2^24 ),
- and( 0xFF, masked_ip / 2^16 ),
- and( 0xFF, masked_ip / 2^8 ),
- and( 0xFF, masked_ip / 2^0 ),
- and( 0xFF, mask / 2^24 ),
- and( 0xFF, mask / 2^16 ),
- and( 0xFF, mask / 2^8 ),
- and( 0xFF, mask / 2^0 ) );
- }
- }
- ' >"${CT_BUILD_DIR}/tsocks.conf"
- ( echo "server = ${server_ip}";
- echo "server_port = ${CT_PROXY_PORT}";
- [ -n "${CT_PROXY_USER}" ] && echo "default_user=${CT_PROXY_USER}";
- [ -n "${CT_PROXY_PASS}" ] && echo "default_pass=${CT_PROXY_PASS}";
- ) >>"${CT_BUILD_DIR}/tsocks.conf"
- case "${CT_PROXY_TYPE/socks}" in
- 4|5) proxy_type="${CT_PROXY_TYPE/socks}";;
- auto)
- reply=$(inspectsocks "${server_ip}" "${CT_PROXY_PORT}" 2>&1 || true)
- case "${reply}" in
- *"server is a version 4 socks server") proxy_type=4;;
- *"server is a version 5 socks server") proxy_type=5;;
- *) CT_Abort "Unable to determine SOCKS proxy type for '${CT_PROXY_HOST}:${CT_PROXY_PORT}'"
- esac
- ;;
- esac
- echo "server_type = ${proxy_type}" >> "${CT_BUILD_DIR}/tsocks.conf"
- 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
- ;;
- esac
-}
-
# Download an URL using wget
# Usage: CT_DoGetFileWget <URL>
CT_DoGetFileWget() {
@@ -521,7 +424,6 @@ CT_GetFile() {
fi
# Scan all URLs in turn, and try to grab a tarball from there
- CT_DoSetProxy ${CT_PROXY_TYPE}
for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do
# Try all urls in turn
for url in ${URLS}; do
@@ -567,7 +469,6 @@ CT_GetCVS() {
CT_MktempDir tmp_dir
CT_Pushd "${tmp_dir}"
- CT_DoSetProxy ${CT_PROXY_TYPE}
CT_DoExecLog ALL cvs -z 9 -d "${uri}" co -P ${tag} "${module}"
[ -n "${dirname}" ] && CT_DoExecLog ALL mv "${module}" "${dirname}"
CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname:-${module}}"
@@ -600,7 +501,6 @@ CT_GetSVN() {
CT_MktempDir tmp_dir
CT_Pushd "${tmp_dir}"
- CT_DoSetProxy ${CT_PROXY_TYPE}
CT_DoExecLog ALL svn export ${rev:+-r ${rev}} "${uri}" "${basename}"
CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${basename}"
CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2"