From c1ae4f21f8b91e1757c65eca85269260cdeb359e Mon Sep 17 00:00:00 2001 From: Augusto Gunsch Date: Thu, 12 Aug 2021 21:58:13 -0300 Subject: [PATCH] Skip missing AUR dependencies --- post-install.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/post-install.sh b/post-install.sh index fe03fd5..613344e 100755 --- a/post-install.sh +++ b/post-install.sh @@ -176,20 +176,21 @@ print_phase() { } install_aur() { - if [ -z "$2" ]; then - echo -ne "Installing ${LGREEN}$1${NC} from AUR..." - else - echo -ne "Installing ${LGREEN}$1${NC} from AUR ($2)..." - fi qpushd "$AUR_BUILD_DIR" quiet sudo -u nobody git clone -q "https://aur.archlinux.org/$1.git" "$1" qpushd "$1" #dependencies for pkg in $(sudo -u nobody makepkg --printsrcinfo | awk '$1 ~ /depends/ {print $3}'); do - install $pkg + install_skip_missing $pkg done + if [ -z "$2" ]; then + echo -ne "Installing ${LGREEN}$1${NC} from AUR..." + else + echo -ne "Installing ${LGREEN}$1${NC} from AUR ($2)..." + fi + quiet sudo -u nobody makepkg --noconfirm quiet pacman -U --noconfirm $1*.pkg.tar* qpopd @@ -223,6 +224,18 @@ install() { echo "done" } +install_skip_missing() { + if [ -z "$2" ]; then + echo -ne "Installing ${LGREEN}$1${NC}..." + else + echo -ne "Installing ${LGREEN}$1${NC} ($2)..." + fi + set +e + quiet pacman -Sq --needed --noconfirm $1 + [ $? -ne 0 ] && echo "Not found: skipping." || echo "done" + set -e +} + prompt() { echo -n "$1 [Y/n] " [ $NO_CONFIRM -eq 1 ] && echo "y" && return 1