From aeb704fee8b4ffeaeddcdb36ae4e1d62c264ce42 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 21 May 2013 10:05:48 +0100 Subject: scripts/bitbake: Handle the case where git isn't installed cleanly 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 --- scripts/bitbake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/bitbake b/scripts/bitbake index ca2bc82d04..31a34b3f16 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 -- cgit 1.2.3-korg