From bb976fe2200aa17b414d052e40447aca53e3e6f7 Mon Sep 17 00:00:00 2001 From: The_miro Date: Fri, 15 May 2026 15:27:07 +0200 Subject: [PATCH] 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 --- update-aur-onebyone.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 update-aur-onebyone.sh diff --git a/update-aur-onebyone.sh b/update-aur-onebyone.sh new file mode 100755 index 0000000..c1af9fc --- /dev/null +++ b/update-aur-onebyone.sh @@ -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