Files
coredesktop/updates.d/20-aur.sh
T
2026-10-31 07:23:08 -06:00

22 lines
643 B
Bash

#!/bin/bash
echo "Updating AUR..."
YAY_FLAGS="--noconfirm --answerdiff=None --answeredit=None --answerclean=None"
# 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 || exit 1
rm -rf yay
git clone https://aur.archlinux.org/yay.git && cd yay || exit 1
makepkg -si --noconfirm
cd .. && rm -rf yay
cd || exit 1
fi
yay -Sua $YAY_FLAGS