* [PATCH] scripts/oe-git-proxy-socks-command: Add fallback to use nc
@ 2012-03-01 23:55 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-03-01 23:55 UTC (permalink / raw)
To: openembedded-core; +Cc: Perez-Gonzalez, Inaky
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>
---
diff --git a/scripts/oe-git-proxy-socks-command b/scripts/oe-git-proxy-socks-command
index 39e0acb..8acffb5 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 $@
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-02 0:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 23:55 [PATCH] scripts/oe-git-proxy-socks-command: Add fallback to use nc Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.