summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-30 11:18:54 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-07 23:08:55 (GMT)
commit8929ffd67c6de431c2561f63c5427df6c354d30f (patch)
treed3a67f1032c39b8fbbebb2f176908ca8dca45fd1 /scripts
parentfcf55f58ae73b4e54ea853c816c0fef0f33ca46c (diff)
downloadpoky-8929ffd67c6de431c2561f63c5427df6c354d30f.tar.gz
oe-init-buildenv/base: Relax python version checks in favour of HOSTTOOLS manipulation
Several distros are now shipping "python" as python v3 contra to the original python guidelines. This causes users confusion/pain in trying to use our tools. We can just force "python" to "python2" within HOSTTOOLS to avoid this issue and hide the complexity from the user. (From OE-Core rev: b06a6cde5c5503f456f260c773cf126085e18c8d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/oe-buildenv-internal11
1 files changed, 1 insertions, 10 deletions
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 6773872..52ce329 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -40,16 +40,7 @@ if [ -z "$OE_SKIP_SDK_CHECK" ] && [ -n "$OECORE_SDK_VERSION" ]; then
40 return 1 40 return 1
41fi 41fi
42 42
43# Make sure we're not using python v3.x as 'python', we don't support it. 43py_v27_check=$(python2 -c 'import sys; print sys.version_info >= (2,7,3)')
44py_v2_check=$(/usr/bin/env python --version 2>&1 | grep "Python 3")
45if [ -n "$py_v2_check" ]; then
46 echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
47 echo >&2 "Please set up python v2 as your default 'python' interpreter."
48 return 1
49fi
50unset py_v2_check
51
52py_v27_check=$(python -c 'import sys; print sys.version_info >= (2,7,3)')
53if [ "$py_v27_check" != "True" ]; then 44if [ "$py_v27_check" != "True" ]; then
54 echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3." 45 echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
55 echo >&2 "Please upgrade your python v2." 46 echo >&2 "Please upgrade your python v2."