Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify install.sh ubuntu version tracking #11288

Merged
merged 4 commits into from
Apr 25, 2022
Merged
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
20 changes: 14 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,24 @@ fi
# Get submodules
git submodule update --init mozilla-ca

UBUNTU_PRE_2004=false
UBUNTU_PRE_2004=0
UBUNTU_2000=0
UBUNTU_2100=0

if $UBUNTU; then
LSB_RELEASE=$(lsb_release -rs)
# In case Ubuntu minimal does not come with bc
if ! command -v bc > /dev/null 2>&1; then
sudo apt install bc -y
fi
# Mint 20.04 responds with 20 here so 20 instead of 20.04
UBUNTU_PRE_2004=$(echo "$LSB_RELEASE<20" | bc)
UBUNTU_2100=$(echo "$LSB_RELEASE>=21" | bc)
if [ "$(echo "$LSB_RELEASE<20" | bc)" = "1" ]; then
UBUNTU_PRE_2004=1
elif [ "$(echo "$LSB_RELEASE<21" | bc)" = "1" ]; then
UBUNTU_2000=1
else
UBUNTU_2100=1
fi
fi

install_python3_and_sqlite3_from_source_with_yum() {
Expand Down Expand Up @@ -114,16 +122,16 @@ install_python3_and_sqlite3_from_source_with_yum() {
# Manage npm and other install requirements on an OS specific basis
if [ "$(uname)" = "Linux" ]; then
#LINUX=1
if [ "$UBUNTU" = "true" ] && [ "$UBUNTU_PRE_2004" = "1" ]; then
if [ "$UBUNTU_PRE_2004" = "1" ]; then
# Ubuntu
echo "Installing on Ubuntu pre 20.04 LTS."
sudo apt-get update
sudo apt-get install -y python3.7-venv python3.7-distutils openssl
elif [ "$UBUNTU" = "true" ] && [ "$UBUNTU_PRE_2004" = "0" ] && [ "$UBUNTU_2100" = "0" ]; then
elif [ "$UBUNTU_2000" = "1" ]; then
echo "Installing on Ubuntu 20.04 LTS."
sudo apt-get update
sudo apt-get install -y python3.8-venv python3-distutils openssl
elif [ "$UBUNTU" = "true" ] && [ "$UBUNTU_2100" = "1" ]; then
elif [ "$UBUNTU_2100" = "1" ]; then
echo "Installing on Ubuntu 21.04 or newer."
sudo apt-get update
sudo apt-get install -y python3.9-venv python3-distutils openssl
Expand Down