]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
install_prereq: Add Linux Mint support.
authorThe_Blode <martin.c.mccarthy@outlook.com>
Fri, 17 Mar 2023 15:51:57 +0000 (15:51 +0000)
committerAsterisk Development Team <asteriskteam@digium.com>
Mon, 8 May 2023 17:55:17 +0000 (17:55 +0000)
ASTERISK-30359 #close

Change-Id: I9c140c7f12ca7dafe65c317f2a26122cf2c72556
(cherry picked from commit e234531f5a3e4eebd409ffcf62795e81d2c0e787)

contrib/scripts/install_prereq

index 98e9350fce99493fd084306ea38d28c1c6e7023d..16a094ec2639b46d8584fb0d3666edac7ce36163 100755 (executable)
@@ -270,6 +270,43 @@ handle_debian() {
        fi
 }
 
+handle_linuxmint() {
+       # Store temporary variable to contain list of missing packages
+       missing_packages=""
+
+       # Check installed packages for Mint
+       for package in $PACKAGES_DEBIAN; do
+               if [ "$package" = "libgmime-2.6-dev" ] || [ "$package" = "libsrtp0-dev" ]; then
+                       continue
+               fi
+
+               missing_package_check=$(apt list --installed 2>/dev/null | grep -c $package)
+
+               if [ "$missing_package_check" -eq 0 ]; then
+                       echo "This package is missing: "$package
+                       missing_packages="${missing_packages} $package"
+               else
+                       echo "Package "$package" is present."
+               fi
+       done
+
+       # Update the packages on our local system
+       echo "==========================="
+       echo "Updating your system's packages"
+       echo "==========================="
+       $testcmd apt update
+
+       # Inform user of packages to be installed
+       echo "==========================="
+       echo "The following packages will be installed on your system:"
+       echo $missing_packages
+       echo "==========================="
+
+       if [ "$missing_packages" != "" ] ; then
+               $testcmd apt -m install -y $missing_packages
+       fi
+}
+
 handle_rh() {
        extra_packs=`check_installed_rpms $PACKAGES_RH`
        if [ x"$extra_packs" != "x" ] ; then
@@ -411,7 +448,11 @@ fi
 
 # The distributions we do support:
 if [ -r /etc/debian_version ]; then
-       handle_debian
+       if [ -f /etc/linuxmint/info ]; then
+               handle_linuxmint
+       else
+               handle_debian
+       fi
 elif [ -r /etc/redhat-release ]; then
        handle_rh
 elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then