add update-aur-onebyone.sh: update AUR packages sequentially

Why: yay -Syu rebuilds everything in one go, making a single failure
stall the whole batch. This script iterates per-package so failures
are isolated and reported at the end.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
main
The_miro 2026-05-15 15:27:07 +02:00
parent bd1c23e6b4
commit bb976fe220
1 changed files with 32 additions and 0 deletions

32
update-aur-onebyone.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
set -u
mapfile -t pkgs < <(yay -Qua | awk '{print $1}')
if [ ${#pkgs[@]} -eq 0 ]; then
echo "No AUR updates available."
exit 0
fi
echo "Found ${#pkgs[@]} AUR package(s) with updates:"
printf ' %s\n' "${pkgs[@]}"
echo
failed=()
for pkg in "${pkgs[@]}"; do
echo "==> Updating $pkg"
if yay -S --noconfirm --answerdiff None --answerclean All --removemake "$pkg"; then
echo "==> $pkg: OK"
else
echo "==> $pkg: FAILED"
failed+=("$pkg")
fi
echo
done
if [ ${#failed[@]} -gt 0 ]; then
echo "Failed packages:"
printf ' %s\n' "${failed[@]}"
exit 1
fi