install_chromium module: added protections, made it Ubuntu version wise

This commit is contained in:
levasseur
2022-02-18 18:30:38 +01:00
parent 204b682414
commit cce5f4d17c

View File

@@ -13,14 +13,26 @@
# none
# ------------------------------------------------------------------------------
export VER_install_chromium="0.0.3"
export VER_install_chromium="0.1.0"
export DEP_install_chromium="upgrade_dist"
install_chromium()
{
# Add Debian Buster repo to sources.list.d directory
prnt I "Ajout du dépot Debian Buster aux sources logicielles..."
# Add Debian repo to sources.list.d directory depending on Ubuntu version
case $SYS_VER in
16.04|16.10|17.04|17.10)
prnt I "Adding Debian Stretch repository to software sources..."
install_file debian_stretch.list /etc/apt/sources.list.d/
;;
18.04|18.10|19.04|19.10)
prnt I "Adding Debian Buster repository to software sources..."
install_file debian_buster.list /etc/apt/sources.list.d/
;;
20.04|20.10|21.04|21.10)
prnt I "Adding Debian Bullseye repository to software sources..."
install_file debian_bullseye.list /etc/apt/sources.list.d/
;;
esac
# Install Debian GPG keys
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DCC9EFBF77E11517
@@ -42,8 +54,26 @@ install_chromium()
precheck_install_chromium()
{
# Nothing to check
:
# Check we run Ubuntu
if [[ $SYS_DIST != "ubuntu" ]]; then
prnt E "The install_chromium module is a Ubuntu only workaround."
die 165
fi
case $SYS_VER in
16.04|16.10|17.04|17.10)
prnt m " * Detected Ubuntu $SYS_VER, will install Stretch version of Chromium"
;;
18.04|18.10|19.04|19.10)
prnt m " * Detected Ubuntu $SYS_VER, will install Buster version of Chromium"
;;
20.04|20.10|21.04|21.10)
prnt m " * Detected Ubuntu $SYS_VER, will install Bullseye version of Chromium"
;;
*)
prnt E "Unable to determine the corresponding Debian version."
die 165
;;
esac
}
export -f install_chromium