diskimage-builder/diskimage_builder/elements/dib-python/pre-install.d/01-dib-python
Ian Wienand 0e230642c5 dib-python : handle centos 8
Match on centos 8 and use the inbuilt system python like on RHEL

Change-Id: I81d94481422b4982777160f736dcf463e2fc45d0
2019-10-03 00:22:18 +00:00

24 lines
605 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 8 ]]; then
# RHEL8 has a system python, separate from the user python. What
# a good idea, abstracting the python binary for system scripts!
# :) Use it for dib-python.
python_path=/usr/libexec/platform-python
else
python_path=$(command -v python${DIB_PYTHON_VERSION})
fi
if [ -z "$python_path" ]; then
echo "Could not find python${DIB_PYTHON_VERSION} executable."
exit 1
fi
ln -sf $python_path /usr/local/bin/dib-python