fix(bash): Handle different Debian versions (#4607)
Co-authored-by: locus313 <locus313@users.noreply.github.com>
This commit is contained in:
@@ -8,8 +8,8 @@ function inst_configureOS() {
|
|||||||
if [ ! -z "$OSDISTRO" ]; then
|
if [ ! -z "$OSDISTRO" ]; then
|
||||||
DISTRO=$OSDISTRO
|
DISTRO=$OSDISTRO
|
||||||
# If available, use LSB to identify distribution
|
# If available, use LSB to identify distribution
|
||||||
elif [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then
|
elif command -v lsb_release >/dev/null 2>&1 ; then
|
||||||
DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
|
DISTRO=$(lsb_release -is)
|
||||||
# Otherwise, use release info file
|
# Otherwise, use release info file
|
||||||
else
|
else
|
||||||
DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1)
|
DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1)
|
||||||
@@ -19,10 +19,10 @@ function inst_configureOS() {
|
|||||||
# add here distro that are debian or ubuntu based
|
# add here distro that are debian or ubuntu based
|
||||||
# TODO: find a better way, maybe checking the existance
|
# TODO: find a better way, maybe checking the existance
|
||||||
# of a package manager
|
# of a package manager
|
||||||
"neon" | "ubuntu")
|
"neon" | "ubuntu" | "Ubuntu")
|
||||||
DISTRO="ubuntu"
|
DISTRO="ubuntu"
|
||||||
;;
|
;;
|
||||||
"debian")
|
"debian" | "Debian")
|
||||||
DISTRO="debian"
|
DISTRO="debian"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
sudo apt-get update
|
if ! command -v lsb_release &>/dev/null ; then
|
||||||
|
sudo apt-get install -y lsb-release
|
||||||
|
fi
|
||||||
|
|
||||||
sudo apt-get install -y git cmake make gcc g++ clang libmysqlclient-dev \
|
DEBIAN_VERSION=$(lsb_release -sr)
|
||||||
libssl1.0-dev libbz2-dev libreadline-dev libncurses-dev \
|
|
||||||
mysql-server libace-6.* libace-dev curl unzip
|
sudo apt-get update -y
|
||||||
|
|
||||||
|
if [[ $DEBIAN_VERSION -eq "10" ]]; then
|
||||||
|
sudo apt-get install -y git cmake make gcc g++ clang default-libmysqlclient-dev \
|
||||||
|
libssl-dev libbz2-dev libreadline-dev libncurses-dev mariadb-server \
|
||||||
|
libace-6.* libace-dev
|
||||||
|
else # Debian 8 and 9 should work using this
|
||||||
|
sudo apt-get install -y git cmake make gcc g++ clang libmysqlclient-dev \
|
||||||
|
libssl1.0-dev libbz2-dev libreadline-dev libncurses-dev \
|
||||||
|
mysql-server libace-6.* libace-dev curl unzip
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user