From 3cba16c186a1963a569e8b4c8f1a61e5ffa9e975 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 3 Mar 2021 12:38:09 +0200 Subject: lite-aeolus: build-init.sh: Install Python from PPA only if needed. Check Python version and install Python 3.6 from PPA only if lower than that. Also, install python3-setuptools package needed by many PyPI packages. Change-Id: Ie28e4b29e2ebc32ac23013ec0e4fae6d155371e9 Signed-off-by: Paul Sokolovsky --- lite-aeolus/build-init.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lite-aeolus') diff --git a/lite-aeolus/build-init.sh b/lite-aeolus/build-init.sh index c7e7fb6bf7..0427b36492 100644 --- a/lite-aeolus/build-init.sh +++ b/lite-aeolus/build-init.sh @@ -1,15 +1,18 @@ #!/bin/bash set -ex -# Zephyr 2.2+ requires Python3.6. As it's not available in official distro -# packages for Ubuntu Xenial (16.04) which we use, install it from PPA. -sudo add-apt-repository -y ppa:deadsnakes/ppa -sudo apt-get -q=2 update -sudo apt-get install -y python3.6 -sudo ln -sf python3.6 /usr/bin/python3 +if python3 --version | grep -q " 3\.[5]"; then + # Zephyr 2.2+ requires Python3.6. As it's not available in official distro + # packages for Ubuntu Xenial (16.04) which we use, install it from PPA. + echo Upgrading Python from deadsnakes PPA + sudo add-apt-repository -y ppa:deadsnakes/ppa + sudo apt-get -q=2 update + sudo apt-get install -y python3.6 + sudo ln -sf python3.6 /usr/bin/python3 +fi #sudo apt-get -q=2 -y install git g++ libc6-dev-i386 g++-multilib python3-ply python3-yaml gcc-arm-none-eabi python-requests rsync device-tree-compiler -sudo apt-get -q=2 -y install python3-pip python-serial python3-serial socat +sudo apt-get -q=2 -y install python3-pip python3-setuptools python-serial python3-serial socat # pip as shipped by distro may be not up to date enough to support some # quirky PyPI packages, specifically cmake was caught like that. -- cgit v1.2.3