diff options
| author | Christopher Larson <chris_larson@mentor.com> | 2012-07-30 09:08:46 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-31 11:38:23 +0100 |
| commit | 780ba469754b538a154d40b0e06e7bb48cbd13a9 (patch) | |
| tree | 7f8f2dbba754aa39002d968b1dc242364280ba13 | |
| parent | 5fe7d0467c668ee6c5b953a45be74e5c2305de3c (diff) | |
| download | poky-780ba469754b538a154d40b0e06e7bb48cbd13a9.tar.gz | |
scripts/bitbake: unbreak the git version comparison
With the current code, we're calling awk to do a floating point comparison
between '1.7.0.4' and '1.7.5' (on an ubuntu 10.04 LTS machine). These clearly
aren't proper floating point numbers, and the comparison is incorrect. It's
returning true for 1.7.0.4 >= 1.7.5.
Instead of using a floating point comparison for this, call out to python and
let it do it.
(From OE-Core rev: f28f6267271edbbef16caec323e9ba76e2216723)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | scripts/bitbake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/bitbake b/scripts/bitbake index 580f377a61..09f8a86240 100755 --- a/scripts/bitbake +++ b/scripts/bitbake | |||
| @@ -64,13 +64,16 @@ GITVERSION=`git --version | cut -d ' ' -f 3` | |||
| 64 | float_test() { | 64 | float_test() { |
| 65 | echo | awk 'END { exit ( !( '"$1"')); }' | 65 | echo | awk 'END { exit ( !( '"$1"')); }' |
| 66 | } | 66 | } |
| 67 | version_compare() { | ||
| 68 | python -c "from distutils.version import LooseVersion; import sys; sys.exit(not (LooseVersion('$1') $2 LooseVersion('$3')))" | ||
| 69 | } | ||
| 67 | 70 | ||
| 68 | # Tar version 1.24 and onwards handle overwriting symlinks correctly | 71 | # Tar version 1.24 and onwards handle overwriting symlinks correctly |
| 69 | # but earlier versions do not; this needs to work properly for sstate | 72 | # but earlier versions do not; this needs to work properly for sstate |
| 70 | float_test "$TARVERSION > 1.23" && needtar="0" | 73 | float_test "$TARVERSION > 1.23" && needtar="0" |
| 71 | 74 | ||
| 72 | # Need git >= 1.7.5 for git-remote --mirror=xxx syntax | 75 | # Need git >= 1.7.5 for git-remote --mirror=xxx syntax |
| 73 | float_test "$GITVERSION >= 1.7.5" && needgit="0" | 76 | version_compare $GITVERSION ">=" 1.7.5 && needgit="0" |
| 74 | 77 | ||
| 75 | 78 | ||
| 76 | buildpseudo="1" | 79 | buildpseudo="1" |
