]> 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)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 10 Apr 2023 18:05:47 +0000 (13:05 -0500)
ASTERISK-30359 #close

Change-Id: I9c140c7f12ca7dafe65c317f2a26122cf2c72556

contrib/scripts/install_prereq

index 58438538f9e754c5d8a70536006d86ffd9d116ba..02374d86d2ebe2f727ded3111ce8d9a0df15f77f 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
@@ -405,7 +442,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