Skip to content

Commit

Permalink
Install pip after running setup_distro (Submitty#3145)
Browse files Browse the repository at this point in the history
* Install pip after running setup_distro

This makes pip available for the extra package setup scripts

* Don't install pip3 as part of rpi.sh
  • Loading branch information
MasterOdin authored and bmcutler committed Nov 30, 2018
1 parent e9beb76 commit c99b355
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
42 changes: 21 additions & 21 deletions .setup/distro_setup/setup_distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ fi
echo "Setting up distro: ${DISTRO} ${VERSION}"
source ${CURRENT_DIR}/${DISTRO}/${VERSION}/setup_distro.sh

# Install pip after we've installed python within the setup_distro.sh
if [ ! -x "$(command -v pip2)" ] || [ ! -x "$(command -v pip3)" ]; then
wget --tries=5 https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
fi

if [ ! -x "$(command -v pip2)" ]; then
python2 /tmp/get-pip.py
else
pip2 install -U pip
fi

if [ ! -x "$(command -v pip3)" ]; then
python3 /tmp/get-pip.py
else
pip3 install -U pip
fi

if [ -f /tmp/get-pip.py ]; then
rm -f /tmp/get-pip.py
fi

# Read through our arguments to get "extra" packages to install for our distro
# ${@} are populated by whatever calls install_system.sh which then sources this
# script.
Expand Down Expand Up @@ -86,24 +107,3 @@ ${DISTRO_LINE}
" > /etc/motd
chmod +rx /etc/motd
fi


if [ ! -x "$(command -v pip2)" ] || [ ! -x "$(command -v pip3)" ]; then
wget --tries=5 https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
fi

if [ ! -x "$(command -v pip2)" ]; then
python2 /tmp/get-pip.py
else
pip2 install -U pip
fi

if [ ! -x "$(command -v pip3)" ]; then
python3 /tmp/get-pip.py
else
pip3 install -U pip
fi

if [ -f /tmp/get-pip.py ]; then
rm -f /tmp/get-pip.py
fi
1 change: 0 additions & 1 deletion .setup/distro_setup/ubuntu/rpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ sudo apt-get install -qqy clisp emacs
echo "Getting pylint..."

# install pylint for python3 using pip
apt install -qqy python3-pip
pip3 install pylint
pip3 install pillow

Expand Down

0 comments on commit c99b355

Please sign in to comment.