diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-17 12:59:28 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-18 14:29:30 +0100 |
| commit | 707cd32457edf014a2e8bd88edd0c453838b18e1 (patch) | |
| tree | 6039e32fd11f24d679283084a165e3efc39d4ab0 /scripts | |
| parent | 63bfda766f678c9701d3dce2955df60c93070ef6 (diff) | |
| download | poky-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')
| -rwxr-xr-x | scripts/bitbake | 17 |
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 | |||
| 58 | fi | 58 | fi |
| 59 | 59 | ||
| 60 | needtar="1" | 60 | needtar="1" |
| 61 | needgit="1" | ||
| 61 | TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4` | 62 | TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4` |
| 63 | GITVERSION=`git --version | cut -d ' ' -f 3` | ||
| 62 | float_test() { | 64 | float_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 |
| 68 | float_test "$TARVERSION > 1.23" && needtar="0" | 70 | float_test "$TARVERSION > 1.23" && needtar="0" |
| 69 | 71 | ||
| 72 | # Need git >= 1.7.5 for git-remote --mirror=xxx syntax | ||
| 73 | float_test "$GITVERSION >= 1.7.5" && needgit="0" | ||
| 74 | |||
| 75 | |||
| 70 | buildpseudo="1" | 76 | buildpseudo="1" |
| 71 | if [ $needpseudo = "1" ]; then | 77 | if [ $needpseudo = "1" ]; then |
| 72 | if [ -e "$BUILDDIR/pseudodone" ]; then | 78 | if [ -e "$BUILDDIR/pseudodone" ]; then |
| @@ -97,6 +103,10 @@ fi | |||
| 97 | if [ -e "$PSEUDOBINDIR/tar" -a "$needtar" = "1" ]; then | 103 | if [ -e "$PSEUDOBINDIR/tar" -a "$needtar" = "1" ]; then |
| 98 | needtar="0" | 104 | needtar="0" |
| 99 | fi | 105 | fi |
| 106 | # If git is already built, we don't want to do it again... | ||
| 107 | if [ -e "$PSEUDOBINDIR/git" -a "$needgit" = "1" ]; then | ||
| 108 | needgit="0" | ||
| 109 | fi | ||
| 100 | 110 | ||
| 101 | if [ $needpseudo = "0" ]; then | 111 | if [ $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 |
