From 6afdf17ec5b3c4b55fc5615b31fd425cc5a10123 Mon Sep 17 00:00:00 2001 From: pvincent Date: Mon, 29 Apr 2024 21:36:12 +0400 Subject: [PATCH] fix --- tools/idem_apt_install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/idem_apt_install b/tools/idem_apt_install index de755b3..78c54e3 100755 --- a/tools/idem_apt_install +++ b/tools/idem_apt_install @@ -1,7 +1,5 @@ #!/bin/bash -source "$MIAOU_BASH_DIR"/lib/functions.sh - function usage { local BASECMD BASECMD=$(basename "$0") @@ -18,6 +16,8 @@ function usage { exit 1 } +source "$MIAOU_BASH_DIR"/lib/functions.sh + [ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 2 [[ $# -lt 1 ]] && usage @@ -38,8 +38,8 @@ debian) ;; arch) for i in "$@"; do - if ! pacman -Ql "$i" 2>/dev/null | grep -q ^ii; then - sudo pacman -Sy "$i" + if ! pacman -Ql "$i" &>/dev/null; then + sudo pacman -S --noconfirm "$i" elif [ -n "${VERBOSE+x}" ] && $VERBOSE; then echo "pacman package <$i> already installed!" fi