Check dependencies to avoid a useless sudo on Archlinux (#17158)

This commit is contained in:
Aurélien Mora 2024-01-12 17:04:10 +01:00 committed by GitHub
parent 17206eea2e
commit c05fd88913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,7 +210,9 @@ elif [ "$(uname)" = "Linux" ]; then
echo "Installing on Arch Linux."
case $(uname -m) in
x86_64|aarch64)
sudo pacman ${PACMAN_AUTOMATED} -S --needed git openssl
if ! pacman -Qs "^git$" > /dev/null || ! pacman -Qs "^openssl$" > /dev/null ; then
sudo pacman ${PACMAN_AUTOMATED} -S --needed git openssl
fi
;;
*)
echo "Incompatible CPU architecture. Must be x86_64 or aarch64."