summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-01 22:09:33 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-02 12:23:56 +0000
commit46c675d85603d7a573bc59638ce615aba9fd7df2 (patch)
treeaa261bcd47462817b7dbe3e64fdf8591937fbc2e
parent5506cc481b7afd9a30af53e8966bcbe2ff67b6d0 (diff)
downloadopenembedded-core-46c675d85603d7a573bc59638ce615aba9fd7df2.tar.gz
openembedded-core-46c675d85603d7a573bc59638ce615aba9fd7df2.tar.bz2
openembedded-core-46c675d85603d7a573bc59638ce615aba9fd7df2.tar.xz
openembedded-core-46c675d85603d7a573bc59638ce615aba9fd7df2.zip
scripts/oe-git-proxy-socks-command: Improve error fallback/handling
If oe-git-proxy-socks isn't available, try and create it. If that fails, tell the user there is a problem, don't just fail to find the command. [YOCTO #2007] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/oe-git-proxy-socks-command15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/oe-git-proxy-socks-command b/scripts/oe-git-proxy-socks-command
index 90fa14e1e..39e0acb79 100755
--- a/scripts/oe-git-proxy-socks-command
+++ b/scripts/oe-git-proxy-socks-command
@@ -1,2 +1,17 @@
#! /bin/bash
+SCRIPTDIR=`dirname $0`
+# Check oe-git-proxy-socks exists
+PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null`
+if [ -z "$PROXYSOCKS" -a -e "$SCRIPTDIR/oe-git-proxy-socks.c" ]; then
+ # If not try and build it
+ gcc $SCRIPTDIR/oe-git-proxy-socks.c -o $SCRIPTDIR/oe-git-proxy-socks
+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
+fi
oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@