diff --git a/updates.d/20-aur.sh b/updates.d/20-aur.sh index c022b22..ce2dcfa 100644 --- a/updates.d/20-aur.sh +++ b/updates.d/20-aur.sh @@ -4,8 +4,11 @@ echo "Updating AUR..." YAY_FLAGS="--noconfirm --answerdiff=None --answeredit=None --answerclean=None" -if ! yay -Sua $YAY_FLAGS 2>/dev/null; then - echo "yay -Sua returned an error. Let's rebuild YAY." +# Only rebuild yay when yay itself is broken (e.g. a pacman upgrade bumped +# libalpm). A failing AUR package is not fixed by a rebuild, so let that error +# show and fail the hook instead. +if ! yay --version &>/dev/null; then + echo "yay is broken (likely a libalpm bump). Rebuilding yay..." sudo pacman -R --noconfirm yay cd /tmp rm -rf yay @@ -15,7 +18,6 @@ if ! yay -Sua $YAY_FLAGS 2>/dev/null; then cd .. rm -rf yay cd - yay -Sua $YAY_FLAGS -else - echo "AUR up to date." fi + +yay -Sua $YAY_FLAGS