Files
coredesktop/updates.d/20-aur.sh
T
2026-10-22 13:13:32 -06:00

24 lines
615 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
rm -rf yay
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
cd ..
rm -rf yay
cd
fi
yay -Sua $YAY_FLAGS