]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/oe-buildenv-internal bitbake: Migrate python version checks
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Jun 2013 17:16:41 +0000 (18:16 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Jun 2013 11:53:26 +0000 (12:53 +0100)
In preparation for removal of the bitbake wrapper script, move the
python version checks to the environment script. There are also
checks within bitbake itself but these may not always function
correctly on every version of python so this is really insurance.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/bitbake
scripts/oe-buildenv-internal

index a8c67bb125b979ac0b0d143ab973558b5c8ab8d9..dde61c405b88c72b8a2a623593ba1c29eaad8157 100755 (executable)
@@ -27,26 +27,6 @@ done
 [ $needpseudo = "0" ] && break
 done
 
-# Make sure we're not using python v3.x. This check can't go into
-# sanity.bbclass because bitbake's source code doesn't even pass
-# parsing stage when used with python v3, so we catch it here so we
-# can offer a meaningful error message.
-py_v3_check=`/usr/bin/env python --version 2>&1 | grep "Python 3"`
-if [ "$py_v3_check" != "" ]; then
-       echo "Bitbake is not compatible with python v3"
-       echo "Please set up python v2 as your default python interpreter"
-       exit 1
-fi
-
-# Similarly, we now have code that doesn't parse correctly with older
-# versions of Python, and rather than fixing that and being 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
-
 if [ ! -e conf/bblayers.conf ] ; then
     BDPRINT=""
     [ -n "$BUILDDIR" ] && BDPRINT=": $BUILDDIR"
index 644df8f30c4dbaa62783a897ab608b362111edb5..a33698c5baae0ac4c7ccf8352b14bfc409b62aa6 100755 (executable)
@@ -29,6 +29,26 @@ if [ ! -z "$OECORE_SDK_VERSION" ]; then
     return 1
 fi
 
+# Make sure we're not using python v3.x. This check can't go into
+# sanity.bbclass because bitbake's source code doesn't even pass
+# parsing stage when used with python v3, so we catch it here so we
+# can offer a meaningful error message.
+py_v3_check=`/usr/bin/env python --version 2>&1 | grep "Python 3"`
+if [ "$py_v3_check" != "" ]; then
+       echo "Bitbake is not compatible with python v3"
+       echo "Please set up python v2 as your default python interpreter"
+       exit 1
+fi
+
+# Similarly, we now have code that doesn't parse correctly with older
+# versions of Python, and rather than fixing that and being 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
+
 if [ "x$BDIR" = "x" ]; then
     if [ "x$1" = "x" ]; then
         BDIR="build"