Skip missing AUR dependencies

This commit is contained in:
Augusto Gunsch 2021-08-12 21:58:13 -03:00
parent d28bfa7efc
commit c1ae4f21f8
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 19 additions and 6 deletions

View File

@ -176,20 +176,21 @@ print_phase() {
} }
install_aur() { 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" qpushd "$AUR_BUILD_DIR"
quiet sudo -u nobody git clone -q "https://aur.archlinux.org/$1.git" "$1" quiet sudo -u nobody git clone -q "https://aur.archlinux.org/$1.git" "$1"
qpushd "$1" qpushd "$1"
#dependencies #dependencies
for pkg in $(sudo -u nobody makepkg --printsrcinfo | awk '$1 ~ /depends/ {print $3}'); do for pkg in $(sudo -u nobody makepkg --printsrcinfo | awk '$1 ~ /depends/ {print $3}'); do
install $pkg install_skip_missing $pkg
done 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 sudo -u nobody makepkg --noconfirm
quiet pacman -U --noconfirm $1*.pkg.tar* quiet pacman -U --noconfirm $1*.pkg.tar*
qpopd qpopd
@ -223,6 +224,18 @@ install() {
echo "done" 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() { prompt() {
echo -n "$1 [Y/n] " echo -n "$1 [Y/n] "
[ $NO_CONFIRM -eq 1 ] && echo "y" && return 1 [ $NO_CONFIRM -eq 1 ] && echo "y" && return 1