
This element is designed to install latest minor versions of different python releases, like py27, py35, py36, py37, py38 into stow directory, and later easily enable them with stow. Change-Id: Iab6d20e7643e549b53c629fb430e58b1c5e72991
28 lines
723 B
Bash
Executable File
28 lines
723 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eux
|
|
set -o pipefail
|
|
|
|
DIB_STOW_PATH="/usr/local/stow"
|
|
|
|
DIB_PY_BUILD_COUNTER=0
|
|
|
|
for pybuilds in $(ls -1 ${DIB_STOW_PATH} | grep "python-"); do
|
|
DIB_PY_BUILD_COUNTER=$((DIB_PY_BUILD_COUNTER+1))
|
|
py_dir_version=$(echo ${pybuilds} | cut -d "-" -f 2)
|
|
py_real_version=$(\
|
|
${DIB_STOW_PATH}/${pybuilds}/bin/python --version | cut -d " " -f 2)
|
|
[[ ${py_real_version} == ${py_dir_version} ]]
|
|
pushd ${DIB_STOW_PATH}
|
|
stow ${pybuilds}
|
|
popd
|
|
py_stow_version=$(\
|
|
/usr/local/bin/python${py_dir_version%.*} --version | cut -d " " -f 2)
|
|
[[ ${py_stow_version} == ${py_dir_version} ]]
|
|
done
|
|
|
|
[ $DIB_PY_BUILD_COUNTER -eq 1 ]
|