Skip to content

Commit 15046c8

Browse files
committed
#245 fixed different python versions
1 parent d9fef0b commit 15046c8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

install.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ function install_apt {
108108
if [ -z "${SKIP_UPDATE}" ]; then
109109
sudo apt-get update
110110
fi
111-
if echo $PYVER|grep "3\."; then
111+
_PYVER=$1
112+
if echo $_PYVER|grep "3\."; then
112113
sudo apt-get -y install libreadline6-dev python3-dev python3-setuptools python3-yaml python3-pip
113114
else
114115
sudo apt-get -y install libreadline6-dev python-dev python-setuptools python-yaml python-pip
@@ -132,7 +133,8 @@ function install_yum {
132133
PARAMS="$PARAMS --refresh"
133134
fi
134135

135-
if echo $PYVER|grep "3\."; then
136+
_PYVER=$1
137+
if echo $_PYVER|grep "3\."; then
136138
sudo $CMD $PARAMS install readline-devel python3-devel python3-setuptools python3-yaml python3-pip
137139
else
138140
sudo $CMD $PARAMS install readline-devel python-devel python-setuptools python-yaml python-pip
@@ -141,8 +143,8 @@ function install_yum {
141143
}
142144

143145
function install_packages {
144-
install_apt
145-
install_yum
146+
install_apt $1
147+
install_yum $1
146148
}
147149

148150
function curl_get_pip {
@@ -204,7 +206,7 @@ if [ "${BACKEND_GDB}" -eq 1 ]; then
204206
GDB_PYTHON=$(${GDB} -batch -q --nx -ex 'pi import sys; print(sys.executable)')
205207
GDB_PYTHON="${GDB_PYTHON/%$GDB_PYVER/}${GDB_PYVER}"
206208

207-
install_packages
209+
install_packages $GDB_PYVER
208210

209211
if [ -z $USER_MODE ]; then
210212
GDB_SITE_PACKAGES=$(${GDB} -batch -q --nx -ex 'pi import site; print(site.getsitepackages()[0])')
@@ -247,7 +249,7 @@ if [ "${BACKEND_LLDB}" -eq 1 ]; then
247249
LLDB_SITE_PACKAGES=$(${LLDB} -Q -x -b --one-line 'script import site; print(site.getusersitepackages())'|tail -1) || quit "Failed to locate site-packages." 1
248250
fi
249251

250-
install_packages || quit "Failed to install packages." 1
252+
install_packages $LLDB_PYVER || quit "Failed to install packages." 1
251253

252254
if [ "$LLDB_SITE_PACKAGES" == "$GDB_SITE_PACKAGES" ]; then
253255
echo "Skipping installation for LLDB - same site-packages directory"
@@ -284,7 +286,7 @@ if [ "${BACKEND_GDB}" -ne 1 ] && [ "${BACKEND_LLDB}" -ne 1 ]; then
284286
PYTHON_SITE_PACKAGES=$(${PYTHON} -c 'import site; print(site.getusersitepackages())')
285287
fi
286288

287-
install_packages
289+
install_packages $PYVER
288290

289291
# Install Voltron and dependencies
290292
${SUDO} ${PYTHON} -m pip install -U $USER_MODE $DEV_MODE .

0 commit comments

Comments
 (0)