aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/oe-git-proxy
diff options
context:
space:
mode:
authorAndré Draszik <adraszik@tycoint.com>2016-03-23 10:47:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-28 15:55:49 +0100
commita15541dc2771b949aead0a97463ddbfe19deea23 (patch)
treedab88e46a75dfc965e74804e48d6d4f132ec1dba /scripts/oe-git-proxy
parent92b2bc5d2755160e007b651d984038693fe43bbb (diff)
downloadopenembedded-core-contrib-a15541dc2771b949aead0a97463ddbfe19deea23.tar.gz
oe-git-proxy: also check all_proxy and http_proxy env variables
(From OE-Core rev: 00fe3004aa624afee62315d5ea7566853b926931) Signed-off-by: André Draszik <adraszik@tycoint.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-git-proxy')
-rwxr-xr-xscripts/oe-git-proxy13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/oe-git-proxy b/scripts/oe-git-proxy
index d2e9f925b7..38ce7b66fd 100755
--- a/scripts/oe-git-proxy
+++ b/scripts/oe-git-proxy
@@ -1,10 +1,12 @@
#!/bin/bash
# oe-git-proxy is a simple tool to be via GIT_PROXY_COMMAND. It uses socat
-# to make SOCKS5 or HTTPS proxy connections. It uses ALL_PROXY to determine the
-# proxy server, protocol, and port. It uses NO_PROXY to skip using the proxy for
-# a comma delimited list of hosts, host globs (*.example.com), IPs, or CIDR
-# masks (192.168.1.0/24). It is known to work with both bash and dash shells.
+# to make SOCKS5 or HTTPS proxy connections.
+# It uses ALL_PROXY or all_proxy or http_proxy to determine the proxy server,
+# protocol, and port.
+# It uses NO_PROXY to skip using the proxy for a comma delimited list of
+# hosts, host globs (*.example.com), IPs, or CIDR masks (192.168.1.0/24). It
+# is known to work with both bash and dash shells.
#
# Example ALL_PROXY values:
# ALL_PROXY=socks://socks.example.com:1080
@@ -99,6 +101,9 @@ match_host() {
# If no proxy is set or needed, just connect directly
METHOD="TCP:$1:$2"
+[ -z "${ALL_PROXY}" ] && ALL_PROXY=$all_proxy
+[ -z "${ALL_PROXY}" ] && ALL_PROXY=$http_proxy
+
if [ -z "$ALL_PROXY" ]; then
exec $SOCAT STDIO $METHOD
fi