[Asterisk-code-review] install_prereq: Add Linux Mint support. (asterisk[master])

Martin McCarthy asteriskteam at digium.com
Fri Mar 17 10:37:52 CDT 2023


Martin McCarthy has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19977 )


Change subject: install_prereq: Add Linux Mint support.
......................................................................

install_prereq: Add Linux Mint support.

ASTERISK-30359 #close

Change-Id: Ie877a405457149991a24e3f519503ccca3da4008
---
M contrib/scripts/install_prereq
1 file changed, 53 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/77/19977/1

diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq
index 5843853..0aea77e 100755
--- a/contrib/scripts/install_prereq
+++ b/contrib/scripts/install_prereq
@@ -270,6 +270,43 @@
 	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 @@
 
 # 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

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19977
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie877a405457149991a24e3f519503ccca3da4008
Gerrit-Change-Number: 19977
Gerrit-PatchSet: 1
Gerrit-Owner: Martin McCarthy <martin.c.mccarthy at outlook.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20230317/b28db902/attachment-0001.html>


More information about the asterisk-code-review mailing list