diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-01 22:09:33 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-02 12:25:19 +0000 |
commit | 64bd33d18826d26d909bba04701e4f643a65279a (patch) | |
tree | 39bf9075cebca98f83a07056557cd45570329865 | |
parent | 6b6aa170d5c618cfcd016dd1de926db647f7f932 (diff) | |
download | poky-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>
-rwxr-xr-x | scripts/oe-git-proxy-socks-command | 15 |
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 |
2 | SCRIPTDIR=`dirname $0` | ||
3 | # Check oe-git-proxy-socks exists | ||
4 | PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null` | ||
5 | if [ -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 | ||
8 | fi | ||
9 | PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null` | ||
10 | if [ ! -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 | ||
16 | fi | ||
2 | oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@ | 17 | oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@ |