From e76d0d34ba20ebacac8c76d1870afa51f5953670 Mon Sep 17 00:00:00 2001 From: Jacob Palecek Date: Wed, 7 Apr 2021 22:40:55 +0200 Subject: [PATCH] Add pacman to the install script The install.sh script was modified to include a test for the pacman package manager, and to use it should it be present. This is necessary for the script to work on Arch based Linux distributions, or more generally ones that use pacman as their main package manager. It was tested by simply trying it out on two local machines, one running Manjaro, one running Arch. In both cases it worked as expected, and without error. Signed-off-by: Jacob Palecek --- hack/install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hack/install.sh b/hack/install.sh index 5030e26..a8616d1 100755 --- a/hack/install.sh +++ b/hack/install.sh @@ -39,6 +39,10 @@ has_apt_get() { [ -n "$(command -v apt-get)" ] } +has_pacman() { + [ -n "$(command -v pacman)" ] +} + install_required_packages() { if $(has_apt_get); then $SUDO apt-get update -y @@ -46,8 +50,11 @@ install_required_packages() { elif $(has_yum); then $SUDO yum check-update -y $SUDO yum install -y curl runc + elif $(has_pacman); then + $SUDO pacman -Syy + $SUDO pacman -Sy curl runc bridge-utils else - fatal "Could not find apt-get or yum. Cannot install dependencies on this OS." + fatal "Could not find apt-get, yum, or pacman. Cannot install dependencies on this OS." exit 1 fi }