Run package-intalls with py3k if we must

Use dib-python to run package-installs using the provided python
version. Automatically detect the python version for our
package-installs-squash since that runs outside the chroot.

Change-Id: I926022bcf8cbcd81b051026ffd5d6477650045ad
This commit is contained in:
Gregory Haynes 2015-12-07 13:03:59 -08:00
parent 3afbeeaf4e
commit d1e32f80a6
4 changed files with 6 additions and 5 deletions

View File

@ -6,9 +6,7 @@ fi
set -eu
set -o pipefail
which which || install-packages which
python_path=$(which python2 || which python3)
python_path=$(command -v python2 || command -v python3)
if [ -z "$python_path" ]; then
echo "Could not find python2 or python3 executable."
exit 1

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/local/bin/dib-python
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#

View File

@ -1 +1,2 @@
dib-python
pkg-map

View File

@ -5,4 +5,6 @@ fi
set -eu
set -o pipefail
sudo -E $(dirname $0)/../bin/package-installs-squash --elements="$IMAGE_ELEMENT" --path=$ELEMENTS_PATH $TMP_MOUNT_PATH/tmp/package-installs.json
python_path=$(command -v python2 || command -v python3)
sudo -E $python_path $(dirname $0)/../bin/package-installs-squash --elements="$IMAGE_ELEMENT" --path=$ELEMENTS_PATH $TMP_MOUNT_PATH/tmp/package-installs.json