]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/bitbake: add a version >= 2.6 check
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 14 Dec 2011 17:35:14 +0000 (17:35 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 15 Dec 2011 14:17:18 +0000 (14:17 +0000)
Unfortunately we now have code in BitBake which is parsed before the
current version check and is incompatible with Python < 2.6. Rather than
fixing this and being eternally vigilant for >= 2.6 feature usage, just
add a version check to the wrapper script.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
scripts/bitbake

index 587428c589a8c2ca3b43d548b846920525a84b8a..1c8d4ebe195eea5fd78b6b9ffa7999b2297aedeb 100755 (executable)
@@ -27,6 +27,15 @@ if [ "$py_v3_check" != "" ]; then
        exit 1
 fi
 
+# Similarly, we now have code that doesn't parse correctly with older
+# versions of Python, and rather than fixing that and be eternally
+# vigilant for any other new feature use, just check the version here.
+py_v26_check=`python -c 'import sys; print sys.version_info >= (2,6,0)'`
+if [ "$py_v26_check" != "True" ]; then
+       echo "BitBake requires Python 2.6 or later"
+       exit 1
+fi
+
 needtar="1"
 TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4`
 float_test() {