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

Martin McCarthy asteriskteam at digium.com
Mon Apr 10 11:44:56 CDT 2023


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


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

install_prereq: Add Linux Mint support.

ASTERISK-30359 #close

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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/20052/1

diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq
index 98e9350..16a094e 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
@@ -411,7 +448,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/+/20052
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I9c140c7f12ca7dafe65c317f2a26122cf2c72556
Gerrit-Change-Number: 20052
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/20230410/d140bd21/attachment.html>


More information about the asterisk-code-review mailing list