Patchwork [3/3] scripts/bitbake: add a version >= 2.6 check

login
register
mail settings
Submitter Paul Eggleton
Date Dec. 14, 2011, 5:31 p.m.
Message ID <f34343a95d4cd6cb69bb4bedb8b60b4ce56d7b15.1323883800.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/16935/
State Accepted
Commit 9b8a48efa3b80fea34efa51de44d10ff2b1e3193
Headers show

Comments

Paul Eggleton - Dec. 14, 2011, 5:31 p.m.
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 |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/scripts/bitbake b/scripts/bitbake
index 587428c..1c8d4eb 100755
--- a/scripts/bitbake
+++ b/scripts/bitbake
@@ -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() {