pvincent 7 months ago
parent
commit
6afdf17ec5
  1. 8
      tools/idem_apt_install

8
tools/idem_apt_install

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
source "$MIAOU_BASH_DIR"/lib/functions.sh
function usage { function usage {
local BASECMD local BASECMD
BASECMD=$(basename "$0") BASECMD=$(basename "$0")
@ -18,6 +16,8 @@ function usage {
exit 1 exit 1
} }
source "$MIAOU_BASH_DIR"/lib/functions.sh
[ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 2 [ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 2
[[ $# -lt 1 ]] && usage [[ $# -lt 1 ]] && usage
@ -38,8 +38,8 @@ debian)
;; ;;
arch) arch)
for i in "$@"; do 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 elif [ -n "${VERBOSE+x}" ] && $VERBOSE; then
echo "pacman package <$i> already installed!" echo "pacman package <$i> already installed!"
fi fi

Loading…
Cancel
Save