[Asterisk-code-review] install_prereq: Remove sudo dependency. (testsuite[master])

Friendly Automation asteriskteam at digium.com
Fri Sep 2 10:18:12 CDT 2022


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

Change subject: install_prereq: Remove sudo dependency.
......................................................................

install_prereq: Remove sudo dependency.

Removes the use of sudo to run commands as root.
The regular Asterisk install_prereq is expected
to be run as root and does not require sudo, so
we do the same to increase portability.

ASTERISK-30202 #close

Change-Id: I72f61cc779c868a312085f4913c03213e90943ca
---
M contrib/scripts/install_prereq
1 file changed, 26 insertions(+), 10 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Michael Bradeen: Looks good to me, but someone else must approve
  Friendly Automation: Approved for Submit




diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq
index e957d03..46970a6 100755
--- a/contrib/scripts/install_prereq
+++ b/contrib/scripts/install_prereq
@@ -85,23 +85,23 @@
 install_debian() {
 	if ! [ -x "$(command -v aptitude)" ]; then
 		if in_test_mode; then
-			echo sudo apt-get install aptitude
+			echo apt-get install aptitude
 			echo "$0: Please install aptitude and try again. Aborting."
 			exit 1
 		fi
-		sudo apt-get install aptitude
+		apt-get install aptitude
 	fi
-	$testcmd sudo aptitude update
+	$testcmd aptitude update
 	extra_packs=`check_installed_debs $PACKAGES_DEBIAN`
 	if [ x"$extra_packs" != "x" ] ; then
-		$testcmd sudo aptitude install -y $extra_packs
+		$testcmd aptitude install -y $extra_packs
 	fi
 }
 
 install_rh() {
 	extra_packs=`check_installed_rpms $PACKAGES_RH`
 	if [ x"$extra_packs" != "x" ] ; then
-		$testcmd sudo yum install -y $extra_packs
+		$testcmd yum install -y $extra_packs
 	fi
 }
 
@@ -144,7 +144,7 @@
 install_asttest() {
 	$testcmd cd asttest
 	$testcmd make
-	$testcmd sudo make install
+	$testcmd make install
 	$testcmd cd ..
 }
 
@@ -155,7 +155,7 @@
 
 	PROJECT_DIR=sipp
 
-	$testcmd sudo rm -rf $PROJECT_DIR
+	$testcmd rm -rf $PROJECT_DIR
 	$testcmd git clone https://github.com/SIPp/sipp $PROJECT_DIR
 	$testcmd cd $PROJECT_DIR
 
@@ -163,7 +163,7 @@
 	$testcmd git checkout v3.5.2
 
 	$testcmd ./build.sh --with-openssl --with-pcap --with-rtpstream --with-sctp
-	$testcmd sudo make install
+	$testcmd make install
 
 	$testcmd cd $SAVE_DIR
 }
@@ -175,7 +175,7 @@
 
 	PROJECT_DIR=pjsua
 
-	$testcmd sudo rm -rf pjsua
+	$testcmd rm -rf pjsua
 	$testcmd git clone https://github.com/asterisk/pjproject $PROJECT_DIR
 	$testcmd cd $PROJECT_DIR
 
@@ -193,7 +193,7 @@
 	$testcmd make
 
 	# The testsuite only cares about pjsua from what we have built.
-	$testcmd sudo cp -v pjsip-apps/bin/pjsua-`uname -m`-*-linux-gnu $MY_BIN/pjsua
+	$testcmd cp -v pjsip-apps/bin/pjsua-`uname -m`-*-linux-gnu $MY_BIN/pjsua
 
 	$testcmd cd $SAVE_DIR
 }

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

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: I72f61cc779c868a312085f4913c03213e90943ca
Gerrit-Change-Number: 19049
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220902/692c3dca/attachment.html>


More information about the asterisk-code-review mailing list