]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/bitbake: Handle the case where git isn't installed cleanly
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 May 2013 09:05:48 +0000 (10:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 May 2013 09:06:11 +0000 (10:06 +0100)
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

index ca2bc82d0424f2725aa338561a8b7b4c1fd693fd..31a34b3f16843795880ee053b0a1eb0489a065e7 100755 (executable)
@@ -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