Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ set -ex
function install_apt {
if [ -n "${APT_GET}" ]; then
if [ -z "${SKIP_UPDATE}" ]; then
sudo apt-get update
${SUDO} apt-get update
fi
if echo $PYVER|grep "3\."; then
sudo apt-get -y install libreadline6-dev python3-dev python3-setuptools python3-yaml python3-pip
_PYVER=$1
if echo $_PYVER|grep "3\."; then
${SUDO} apt-get -y install libreadline6-dev python3-dev python3-setuptools python3-yaml python3-pip
else

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo -> ${SUDO}

Since in containers there is no sudo typically installed.

sudo apt-get -y install libreadline6-dev python-dev python-setuptools python-yaml python-pip
${SUDO} apt-get -y install libreadline6-dev python-dev python-setuptools python-yaml python-pip
fi
fi
}
Expand All @@ -132,17 +133,18 @@ function install_yum {
PARAMS="$PARAMS --refresh"
fi

if echo $PYVER|grep "3\."; then
sudo $CMD $PARAMS install readline-devel python3-devel python3-setuptools python3-yaml python3-pip
_PYVER=$1
if echo $_PYVER|grep "3\."; then
${SUDO} $CMD $PARAMS install readline-devel python3-devel python3-setuptools python3-yaml python3-pip
else

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

sudo $CMD $PARAMS install readline-devel python-devel python-setuptools python-yaml python-pip
${SUDO} $CMD $PARAMS install readline-devel python-devel python-setuptools python-yaml python-pip
fi
fi
}

function install_packages {
install_apt
install_yum
install_apt $1
install_yum $1
}

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

install_packages
install_packages $GDB_PYVER

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

install_packages || quit "Failed to install packages." 1
install_packages $LLDB_PYVER || quit "Failed to install packages." 1

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

install_packages
install_packages $PYVER

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