]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake wrapper: exit if python v3 is detected
authorScott Garman <scott.a.garman@intel.com>
Wed, 15 Jun 2011 01:16:29 +0000 (18:16 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Jun 2011 11:09:52 +0000 (12:09 +0100)
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.

This fixes bug [YOCTO #1128]

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
scripts/bitbake

index 3923421cec06d394d5c9897622313a5e0c6561a9..587428c589a8c2ca3b43d548b846920525a84b8a 100755 (executable)
@@ -16,6 +16,17 @@ 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
+
 needtar="1"
 TARVERSION=`tar --version | head -n 1 | cut -d ' ' -f 4`
 float_test() {