summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-01 23:53:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-02 12:24:05 +0000
commitaaab6ae94258277dcd2f29823a64689e6245fa7a (patch)
tree0436c6589b93263b9192c863aaed457c6a8ffbf3
parent46c675d85603d7a573bc59638ce615aba9fd7df2 (diff)
downloadopenembedded-core-aaab6ae94258277dcd2f29823a64689e6245fa7a.tar.gz
openembedded-core-aaab6ae94258277dcd2f29823a64689e6245fa7a.tar.bz2
openembedded-core-aaab6ae94258277dcd2f29823a64689e6245fa7a.zip
scripts/oe-git-proxy-socks-command: Add fallback to use nc
If our own proxy command isn't available for some reason and nc is available, fall back to use it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/oe-git-proxy-socks-command16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/oe-git-proxy-socks-command b/scripts/oe-git-proxy-socks-command
index 39e0acb798..8acffb5248 100755
--- a/scripts/oe-git-proxy-socks-command
+++ b/scripts/oe-git-proxy-socks-command
@@ -8,10 +8,16 @@ if [ -z "$PROXYSOCKS" -a -e "$SCRIPTDIR/oe-git-proxy-socks.c" ]; then
fi
PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null`
if [ ! -x "$PROXYSOCKS" ]; then
- # If that fails, explain to the user
- echo "Unable to find oe-git-proxy-socks. This is usually created with the command"
- echo "'gcc scripts/oe-git-proxy-socks.c -o scripts/oe-git-proxy-socks' which we tried"
- echo "but it doesn't seem to have worked. Please compile the binary manually."
- exit 1
+ # If that fails, we can see if netcat (nc) is available
+ NETCAT=`which nc 2> /dev/null`
+ if [ ! -x "$NETCAT" ]; then
+ # If that fails, explain to the user
+ echo "Unable to find oe-git-proxy-socks. This is usually created with the command"
+ echo "'gcc scripts/oe-git-proxy-socks.c -o scripts/oe-git-proxy-socks' which we tried"
+ echo "but it doesn't seem to have worked. Please compile the binary manually."
+ echo "Alternativly, install nc (netcat) on this machine."
+ exit 1
+ fi
+ exec $NETCAT -x $GIT_PROXY_HOST:$GIT_PROXY_PORT "$@"
fi
oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@