public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] scripts/bitbake: Handle the case where git isn't installed cleanly
Date: Tue, 21 May 2013 10:05:48 +0100	[thread overview]
Message-ID: <1369127148.11013.14.camel@ted> (raw)

Currently the user sees ugly errors if git isn't installed, this patch
cleans up the code to correctly handle that case.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/bitbake | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/scripts/bitbake b/scripts/bitbake
index ca2bc82..31a34b3 100755
--- a/scripts/bitbake
+++ b/scripts/bitbake
@@ -60,7 +60,7 @@ fi
 needtar="1"
 needgit="1"
 TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4`
-GITVERSION=`git --version | cut -d ' ' -f 3`
+GITVERSION=`git --version 2> /dev/null | cut -d ' ' -f 3`
 float_test() {
      echo | awk 'END { exit ( !( '"$1"')); }'
 }
@@ -72,9 +72,10 @@ version_compare() {
 # but earlier versions do not; this needs to work properly for sstate
 float_test "$TARVERSION > 1.23" && needtar="0"
 
-# Need git >= 1.7.5 for git-remote --mirror=xxx syntax
-version_compare $GITVERSION ">=" 1.7.5 && needgit="0"
-
+if [ ! -z $GITVERSION ]; then
+    # Need git >= 1.7.5 for git-remote --mirror=xxx syntax
+    version_compare $GITVERSION ">=" 1.7.5 && needgit="0"
+fi
 
 buildpseudo="1"
 if [ $needpseudo = "1" ]; then




                 reply	other threads:[~2013-05-21 12:14 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=1369127148.11013.14.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --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