summaryrefslogtreecommitdiffstats
path: root/scripts/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-17 12:59:28 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-18 14:29:30 +0100
commit707cd32457edf014a2e8bd88edd0c453838b18e1 (patch)
tree6039e32fd11f24d679283084a165e3efc39d4ab0 /scripts/bitbake
parent63bfda766f678c9701d3dce2955df60c93070ef6 (diff)
downloadpoky-707cd32457edf014a2e8bd88edd0c453838b18e1.tar.gz
scripts/bitbake: Check the git-native version and build it if necessary
We require git version 1.7.5 or later for the git remote --mirror=xxx syntax. If we have an older version of git, this patch ensure we build git-replacement-native. We add an alternative PROVIDES in the same way as tar-native to allow this script to trigger the build whilst still allowing git-native in ASSUME_PROVIDED. (From OE-Core rev: 269f3b3cfacaf229d5e45177ee01b16561370ee3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/bitbake')
-rwxr-xr-xscripts/bitbake17
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/bitbake b/scripts/bitbake
index 3772d826fe..580f377a61 100755
--- a/scripts/bitbake
+++ b/scripts/bitbake
@@ -58,7 +58,9 @@ elif [ -z "$BUILDDIR" ] ; then
58fi 58fi
59 59
60needtar="1" 60needtar="1"
61needgit="1"
61TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4` 62TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4`
63GITVERSION=`git --version | cut -d ' ' -f 3`
62float_test() { 64float_test() {
63 echo | awk 'END { exit ( !( '"$1"')); }' 65 echo | awk 'END { exit ( !( '"$1"')); }'
64} 66}
@@ -67,6 +69,10 @@ float_test() {
67# but earlier versions do not; this needs to work properly for sstate 69# but earlier versions do not; this needs to work properly for sstate
68float_test "$TARVERSION > 1.23" && needtar="0" 70float_test "$TARVERSION > 1.23" && needtar="0"
69 71
72# Need git >= 1.7.5 for git-remote --mirror=xxx syntax
73float_test "$GITVERSION >= 1.7.5" && needgit="0"
74
75
70buildpseudo="1" 76buildpseudo="1"
71if [ $needpseudo = "1" ]; then 77if [ $needpseudo = "1" ]; then
72 if [ -e "$BUILDDIR/pseudodone" ]; then 78 if [ -e "$BUILDDIR/pseudodone" ]; then
@@ -97,6 +103,10 @@ fi
97if [ -e "$PSEUDOBINDIR/tar" -a "$needtar" = "1" ]; then 103if [ -e "$PSEUDOBINDIR/tar" -a "$needtar" = "1" ]; then
98 needtar="0" 104 needtar="0"
99fi 105fi
106# If git is already built, we don't want to do it again...
107if [ -e "$PSEUDOBINDIR/git" -a "$needgit" = "1" ]; then
108 needgit="0"
109fi
100 110
101if [ $needpseudo = "0" ]; then 111if [ $needpseudo = "0" ]; then
102 buildpseudo="0" 112 buildpseudo="0"
@@ -123,6 +133,11 @@ if [ $buildpseudo -gt 0 ]; then
123 if [ $needtar = "0" ]; then 133 if [ $needtar = "0" ]; then
124 TARTARGET="" 134 TARTARGET=""
125 fi 135 fi
136 GITTARGET="git-replacement-native"
137 if [ $needgit = "0" ]; then
138 GITTARGET=""
139 fi
140
126 # Pass through debug options 141 # Pass through debug options
127 additionalopts="" 142 additionalopts=""
128 for opt in $@; do 143 for opt in $@; do
@@ -134,7 +149,7 @@ if [ $buildpseudo -gt 0 ]; then
134 fi 149 fi
135 done 150 done
136 done 151 done
137 bitbake pseudo-native $TARTARGET $additionalopts -c populate_sysroot 152 bitbake pseudo-native $TARTARGET $GITTARGET $additionalopts -c populate_sysroot
138 ret=$? 153 ret=$?
139 if [ "$ret" != "0" ]; then 154 if [ "$ret" != "0" ]; then
140 exit 1 155 exit 1