File: 71-test-python-stow

package info (click to toggle)
python-diskimage-builder 3.39.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,704 kB
  • sloc: sh: 7,474; python: 6,454; makefile: 37
file content (27 lines) | stat: -rwxr-xr-x 723 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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 ]