Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. # Make sure we're not using python v3.x as 'python', we don't support it.
  2. py_v2_check=$(/usr/bin/env python --version 2>&1 | grep "Python 3")
  3. if [ -n "$py_v2_check" ]; then
  4. echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
  5. echo >&2 "Please set up python v2 as your default 'python' interpreter."
  6. return 1
  7. fi
  8. unset py_v2_check
  9.  
  10. py_v27_check=$(python -c 'import sys; print sys.version_info >= (2,7,3)')
  11. if [ "$py_v27_check" != "True" ]; then
  12. echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
  13. echo >&2 "Please upgrade your python v2."
  14. fi
  15. unset py_v27_check
  16.  
  17. # We potentially have code that doesn't parse correctly with older versions
  18. # of Python, and rather than fixing that and being eternally vigilant for
  19. # any other new feature use, just check the version here.
  20. py_v34_check=$(python3 -c 'import sys; print(sys.version_info >= (3,4,0))')
  21. if [ "$py_v34_check" != "True" ]; then
  22. echo >&2 "BitBake requires Python 3.4.0 or later as 'python3'"
  23. return 1
  24. fi
  25. unset py_v34_check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement