File tree Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
- if [[ -f /etc/os-release ]]; then
6
- . /etc/os-release
7
- OS=$ID
8
- OS_VERSION=$VERSION_ID
9
- else
10
- exit 1
11
- fi
5
+ PYTHON_VERSION=${PYTHON_VERSION:- }
12
6
13
- MAJOR_VERSION=$( echo $OS_VERSION | cut -d. -f1)
7
+ if [[ " $PYTHON_VERSION " == " " ]]; then
8
+ if [[ -f /etc/os-release ]]; then
9
+ . /etc/os-release
10
+ OS=$ID
11
+ OS_VERSION=$VERSION_ID
12
+ else
13
+ exit 1
14
+ fi
14
15
15
- PYTHON_VERSION= " "
16
+ MAJOR_VERSION= $( echo $OS_VERSION | cut -d. -f1 )
16
17
17
- if [[ " $OS " == " ubuntu" && " $MAJOR_VERSION " == " 22" ]]; then
18
- PYTHON_VERSION=" /usr/bin/python3.10"
19
- elif [[ " $OS " == " rocky" && " $MAJOR_VERSION " == " 8" ]]; then
20
- # python3.9+ doesn't have selinux bindings
21
- PYTHON_VERSION=" /usr/bin/python3.8" # use `sudo yum install python38` on Rocky Linux 8 to install this
22
- elif [[ " $OS " == " rocky" && " $MAJOR_VERSION " == " 9" ]]; then
23
- PYTHON_VERSION=" /usr/bin/python3.9"
24
- else
25
- echo " Unsupported OS version: $OS $MAJOR_VERSION "
26
- exit 1
18
+ if [[ " $OS " == " ubuntu" && " $MAJOR_VERSION " == " 22" ]]; then
19
+ PYTHON_VERSION=" /usr/bin/python3.10"
20
+ elif [[ " $OS " == " rocky" && " $MAJOR_VERSION " == " 8" ]]; then
21
+ # python3.9+ doesn't have selinux bindings
22
+ PYTHON_VERSION=" /usr/bin/python3.8" # use `sudo yum install python38` on Rocky Linux 8 to install this
23
+ elif [[ " $OS " == " rocky" && " $MAJOR_VERSION " == " 9" ]]; then
24
+ PYTHON_VERSION=" /usr/bin/python3.9"
25
+ else
26
+ echo " Unsupported OS version: $OS $MAJOR_VERSION "
27
+ exit 1
28
+ fi
27
29
fi
28
30
29
31
if [[ ! -d " venv" ]]; then
You can’t perform that action at this time.
0 commit comments