summaryrefslogtreecommitdiffstats
path: root/scripts/oe-git-proxy-socks-command
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:25:19 +0000
commit64bd33d18826d26d909bba04701e4f643a65279a (patch)
tree39bf9075cebca98f83a07056557cd45570329865 /scripts/oe-git-proxy-socks-command
parent6b6aa170d5c618cfcd016dd1de926db647f7f932 (diff)
downloadpoky-64bd33d18826d26d909bba04701e4f643a65279a.tar.gz
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] (From OE-Core rev: 46c675d85603d7a573bc59638ce615aba9fd7df2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-git-proxy-socks-command')
-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 90fa14e1ed..39e0acb798 100755
--- a/scripts/oe-git-proxy-socks-command
+++ b/scripts/oe-git-proxy-socks-command
@@ -1,2 +1,17 @@
1#! /bin/bash 1#! /bin/bash
2SCRIPTDIR=`dirname $0`
3# Check oe-git-proxy-socks exists
4PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null`
5if [ -z "$PROXYSOCKS" -a -e "$SCRIPTDIR/oe-git-proxy-socks.c" ]; then
6 # If not try and build it
7 gcc $SCRIPTDIR/oe-git-proxy-socks.c -o $SCRIPTDIR/oe-git-proxy-socks
8fi
9PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null`
10if [ ! -x "$PROXYSOCKS" ]; then
11 # If that fails, explain to the user
12 echo "Unable to find oe-git-proxy-socks. This is usually created with the command"
13 echo "'gcc scripts/oe-git-proxy-socks.c -o scripts/oe-git-proxy-socks' which we tried"
14 echo "but it doesn't seem to have worked. Please compile the binary manually."
15 exit 1
16fi
2oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@ 17oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@