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

Friendly Automation asteriskteam at digium.com
Sat Sep 10 13:21:48 CDT 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/testsuite/+/19168 )

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(-)

Approvals:
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit




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/+/19168
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 19
Gerrit-Change-Id: I5266940fe3c7152bed519945fe6f93f49572c47e
Gerrit-Change-Number: 19168
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220910/a43a01bc/attachment-0001.html>


More information about the asterisk-code-review mailing list