Update AUR packages after system pkgs + migrate

As AUR packages need local compiling and that might fail. Which
shouldn't prevent migrations from running.
This commit is contained in:
David Heinemeier Hansson
2026-01-19 10:49:46 -05:00
parent 21514dc577
commit bfc3c69cf1
3 changed files with 25 additions and 12 deletions

24
bin/omarchy-update-aur-pkgs Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
set -e
# Update AUR packages if any are installed
if pacman -Qem >/dev/null; then
if omarchy-pkg-aur-accessible; then
echo -e "\e[32m\nUpdate AUR packages\e[0m"
yay -Sua --noconfirm --ignore gcc14,gcc14-libs
echo
else
echo -e "\e[31m\nAUR is unavailable (so skipping updates)\e[0m"
echo
fi
fi
orphans=$(pacman -Qtdq || true)
if [[ -n $orphans ]]; then
echo -e "\e[32m\nRemove orphan system packages\e[0m"
for pkg in $orphans; do
sudo pacman -Rs --noconfirm "$pkg" || true
done
echo
fi

View File

@@ -14,6 +14,7 @@ omarchy-update-keyring
omarchy-update-available-reset omarchy-update-available-reset
omarchy-update-system-pkgs omarchy-update-system-pkgs
omarchy-migrate omarchy-migrate
omarchy-update-aur-pkgs
omarchy-hook post-update omarchy-hook post-update
omarchy-update-analyze-logs omarchy-update-analyze-logs

View File

@@ -5,18 +5,6 @@ set -e
echo -e "\e[32m\nUpdate system packages\e[0m" echo -e "\e[32m\nUpdate system packages\e[0m"
sudo pacman -Syyu --noconfirm sudo pacman -Syyu --noconfirm
# Update AUR packages if any are installed
if pacman -Qem >/dev/null; then
if omarchy-pkg-aur-accessible; then
echo -e "\e[32m\nUpdate AUR packages\e[0m"
yay -Sua --noconfirm --ignore gcc14,gcc14-libs
echo
else
echo -e "\e[31m\nAUR is unavailable (so skipping updates)\e[0m"
echo
fi
fi
orphans=$(pacman -Qtdq || true) orphans=$(pacman -Qtdq || true)
if [[ -n $orphans ]]; then if [[ -n $orphans ]]; then
echo -e "\e[32m\nRemove orphan system packages\e[0m" echo -e "\e[32m\nRemove orphan system packages\e[0m"