summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-07 17:16:41 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-14 11:53:52 (GMT)
commitec7d9359b46b5058c52e2283a7235d2b9c89152a (patch)
tree314fb6e4f72fb7bf00872f809d9256249e6d9415 /scripts
parentcfbd13ff2267a10767327622c9cf5bf889e75a80 (diff)
downloadpoky-ec7d9359b46b5058c52e2283a7235d2b9c89152a.tar.gz
scripts/oe-buildenv-internal bitbake: Migrate python version checks
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. (From OE-Core rev: 07792e4a83ca4f1c8152c228813c7f795fa6a545) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bitbake20
-rwxr-xr-xscripts/oe-buildenv-internal20
2 files changed, 20 insertions, 20 deletions
diff --git a/scripts/bitbake b/scripts/bitbake
index a8c67bb..dde61c4 100755
--- a/scripts/bitbake
+++ b/scripts/bitbake
@@ -27,26 +27,6 @@ done
27[ $needpseudo = "0" ] && break 27[ $needpseudo = "0" ] && break
28done 28done
29 29
30# Make sure we're not using python v3.x. This check can't go into
31# sanity.bbclass because bitbake's source code doesn't even pass
32# parsing stage when used with python v3, so we catch it here so we
33# can offer a meaningful error message.
34py_v3_check=`/usr/bin/env python --version 2>&1 | grep "Python 3"`
35if [ "$py_v3_check" != "" ]; then
36 echo "Bitbake is not compatible with python v3"
37 echo "Please set up python v2 as your default python interpreter"
38 exit 1
39fi
40
41# Similarly, we now have code that doesn't parse correctly with older
42# versions of Python, and rather than fixing that and being eternally
43# vigilant for any other new feature use, just check the version here.
44py_v26_check=`python -c 'import sys; print sys.version_info >= (2,6,0)'`
45if [ "$py_v26_check" != "True" ]; then
46 echo "BitBake requires Python 2.6 or later"
47 exit 1
48fi
49
50if [ ! -e conf/bblayers.conf ] ; then 30if [ ! -e conf/bblayers.conf ] ; then
51 BDPRINT="" 31 BDPRINT=""
52 [ -n "$BUILDDIR" ] && BDPRINT=": $BUILDDIR" 32 [ -n "$BUILDDIR" ] && BDPRINT=": $BUILDDIR"
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 644df8f..a33698c 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -29,6 +29,26 @@ if [ ! -z "$OECORE_SDK_VERSION" ]; then
29 return 1 29 return 1
30fi 30fi
31 31
32# Make sure we're not using python v3.x. This check can't go into
33# sanity.bbclass because bitbake's source code doesn't even pass
34# parsing stage when used with python v3, so we catch it here so we
35# can offer a meaningful error message.
36py_v3_check=`/usr/bin/env python --version 2>&1 | grep "Python 3"`
37if [ "$py_v3_check" != "" ]; then
38 echo "Bitbake is not compatible with python v3"
39 echo "Please set up python v2 as your default python interpreter"
40 exit 1
41fi
42
43# Similarly, we now have code that doesn't parse correctly with older
44# versions of Python, and rather than fixing that and being eternally
45# vigilant for any other new feature use, just check the version here.
46py_v26_check=`python -c 'import sys; print sys.version_info >= (2,6,0)'`
47if [ "$py_v26_check" != "True" ]; then
48 echo "BitBake requires Python 2.6 or later"
49 exit 1
50fi
51
32if [ "x$BDIR" = "x" ]; then 52if [ "x$BDIR" = "x" ]; then
33 if [ "x$1" = "x" ]; then 53 if [ "x$1" = "x" ]; then
34 BDIR="build" 54 BDIR="build"