Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Cc: "Perez-Gonzalez,	Inaky" <inaky.perez-gonzalez@intel.com>
Subject: [PATCH] scripts/oe-git-proxy-socks-command: Improve error fallback/handling
Date: Thu, 01 Mar 2012 22:11:47 +0000	[thread overview]
Message-ID: <1330639907.12133.12.camel@ted> (raw)

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>
---
diff --git a/scripts/oe-git-proxy-socks-command b/scripts/oe-git-proxy-socks-command
index 90fa14e..39e0acb 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 $@





                 reply	other threads:[~2012-03-01 22:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330639907.12133.12.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox