aboutsummaryrefslogtreecommitdiff
path: root/lite-aeolus
diff options
context:
space:
mode:
authorPaul Sokolovsky <paul.sokolovsky@linaro.org>2021-03-03 12:38:09 +0200
committerPaul Sokolovsky <paul.sokolovsky@linaro.org>2021-03-03 12:38:09 +0200
commit3cba16c186a1963a569e8b4c8f1a61e5ffa9e975 (patch)
treeadfd558737926ff4109d3fefa7f28586251f03ef /lite-aeolus
parent36bc9eea2ed63f8e074f28883bf7cf408f712054 (diff)
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 <paul.sokolovsky@linaro.org>
Diffstat (limited to 'lite-aeolus')
-rw-r--r--lite-aeolus/build-init.sh17
1 files changed, 10 insertions, 7 deletions
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.