From daf5a4e4bd81a2383a06ce8d2bcb14f23e39ea15 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 2 May 2019 14:06:14 -0400 Subject: [PATCH] Switch simple-init to support python3 Depending on the version of $DIB_PYTHON_VERSION, we can either use pip / pip3 to install glean. This is helpful for newer OSes that might not want to ship python2 (pip). Change-Id: I25c5927a1eb55ee16b919dd64403184f335839b6 Signed-off-by: Paul Belanger --- .../simple-init/install.d/simple-init-repo-install/40-glean | 6 +++++- .../install.d/simple-init-source-install/40-glean | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean b/diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean index 5ba29a53..18211e86 100755 --- a/diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean +++ b/diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean @@ -21,4 +21,8 @@ fi set -eu set -o pipefail -pip install /tmp/glean.git +if [ "$DIB_PYTHON_VERSION" == "3" ]; then + pip3 install /tmp/glean.git +else + pip install /tmp/glean.git +fi diff --git a/diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean b/diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean index 11266c4e..ae1ce320 100755 --- a/diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean +++ b/diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean @@ -21,4 +21,8 @@ fi set -eu set -o pipefail -pip install glean +if [ "$DIB_PYTHON_VERSION" == "3" ]; then + pip3 install glean +else + pip install glean +fi