瀏覽代碼

scripts/bitbake: add a version >= 2.6 check

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.

(From OE-Core rev: 9b8a48efa3b80fea34efa51de44d10ff2b1e3193)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Paul Eggleton 12 年之前
父節點
當前提交
c3ba7e8f7a
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      scripts/bitbake

+ 9 - 0
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() {