diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-01 23:53:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-02 12:25:19 +0000 |
commit | 6fd4699d077736c54eb3aa31b62593cc5bd82fdc (patch) | |
tree | 74b967716a2586b70bf167d9c7ae23b5e59ad785 /scripts/oe-git-proxy-socks-command | |
parent | 64bd33d18826d26d909bba04701e4f643a65279a (diff) | |
download | poky-6fd4699d077736c54eb3aa31b62593cc5bd82fdc.tar.gz |
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.
(From OE-Core rev: aaab6ae94258277dcd2f29823a64689e6245fa7a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-git-proxy-socks-command')
-rwxr-xr-x | scripts/oe-git-proxy-socks-command | 16 |
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 | |||
8 | fi | 8 | fi |
9 | PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null` | 9 | PROXYSOCKS=`which oe-git-proxy-socks 2> /dev/null` |
10 | if [ ! -x "$PROXYSOCKS" ]; then | 10 | if [ ! -x "$PROXYSOCKS" ]; then |
11 | # If that fails, explain to the user | 11 | # If that fails, we can see if netcat (nc) is available |
12 | echo "Unable to find oe-git-proxy-socks. This is usually created with the command" | 12 | NETCAT=`which nc 2> /dev/null` |
13 | echo "'gcc scripts/oe-git-proxy-socks.c -o scripts/oe-git-proxy-socks' which we tried" | 13 | if [ ! -x "$NETCAT" ]; then |
14 | echo "but it doesn't seem to have worked. Please compile the binary manually." | 14 | # If that fails, explain to the user |
15 | exit 1 | 15 | echo "Unable to find oe-git-proxy-socks. This is usually created with the command" |
16 | echo "'gcc scripts/oe-git-proxy-socks.c -o scripts/oe-git-proxy-socks' which we tried" | ||
17 | echo "but it doesn't seem to have worked. Please compile the binary manually." | ||
18 | echo "Alternativly, install nc (netcat) on this machine." | ||
19 | exit 1 | ||
20 | fi | ||
21 | exec $NETCAT -x $GIT_PROXY_HOST:$GIT_PROXY_PORT "$@" | ||
16 | fi | 22 | fi |
17 | oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@ | 23 | oe-git-proxy-socks -S $GIT_PROXY_HOST:$GIT_PROXY_PORT $@ |