[Asterisk-code-review] install_prereq: Add support for Arch systems. (testsuite[master])

Joshua Colp asteriskteam at digium.com
Fri Sep 9 07:14:12 CDT 2022


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/19199 )


Change subject: install_prereq: Add support for Arch systems.
......................................................................

install_prereq: Add support for Arch systems.

ASTERISK-30218

Change-Id: I5266940fe3c7152bed519945fe6f93f49572c47e
---
M contrib/scripts/install_prereq
1 file changed, 38 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/99/19199/1

diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq
index a131db1..67a9efa 100755
--- a/contrib/scripts/install_prereq
+++ b/contrib/scripts/install_prereq
@@ -30,6 +30,15 @@
 # Sipp requirements
 PACKAGES_RH="$PACKAGES_RH libpcap-devel openssl-devel lksctp-tools-devel"
 
+# Basic build system:
+PACKAGES_ARCH="git gcc"
+# Python tools
+PACKAGES_ARCH="$PACKAGES_ARCH python python-pip python-setuptools"
+# Testsuite: basic requirements:
+PACKAGES_ARCH="$PACKAGES_ARCH lua51 gdb"
+# Sipp requirements
+PACKAGES_ARCH="$PACKAGES_ARCH libpcap openssl lksctp-tools"
+
 LIBDIR=/usr/lib$(getconf LONG_BIT | fgrep 64)
 [ ! -d $LIBDIR ] && LIBDIR=/usr/lib
 
@@ -82,6 +91,15 @@
 	done
 }
 
+check_installed_pacman() {
+	for pack in "$@"
+	do
+		if ! pacman -Q --explicit $pack >/dev/null 2>/dev/null
+		then echo $pack
+		fi
+	done
+}
+
 install_debian() {
 	if ! [ -x "$(command -v aptitude)" ]; then
 		if in_test_mode; then
@@ -105,6 +123,13 @@
 	fi
 }
 
+install_arch() {
+	extra_packs=`check_installed_pacman $PACKAGES_ARCH`
+	if [ x"$extra_packs" != "x" ] ; then
+		$testcmd pacman -S --asexplicit --noconfirm $extra_packs
+	fi
+}
+
 OS=`uname -s`
 
 # A number of distributions we don't (yet?) support.
@@ -136,6 +161,8 @@
 	install_packages=install_debian
 elif [ -r /etc/redhat-release ]; then
 	install_packages=install_rh
+elif [ -r /etc/arch-release ]; then
+	install_packages=install_arch
 else
 	echo >&2 "$0: Your distribution is currently not supported. Aborting."
 	exit 1

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: I5266940fe3c7152bed519945fe6f93f49572c47e
Gerrit-Change-Number: 19199
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220909/2c2a9129/attachment.html>


More information about the asterisk-code-review mailing list