Split out removing orphan packages as well

And make sure failed AUR update doesn't fail the update entirely
This commit is contained in:
David Heinemeier Hansson
2026-01-19 12:21:06 -05:00
parent bfc3c69cf1
commit 4701726c83
4 changed files with 11 additions and 20 deletions

View File

@@ -1,7 +1,5 @@
#!/bin/bash
set -e
# Update AUR packages if any are installed
if pacman -Qem >/dev/null; then
if omarchy-pkg-aur-accessible; then
@@ -13,12 +11,3 @@ if pacman -Qem >/dev/null; then
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

10
bin/omarchy-update-orphan-pkgs Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
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

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

View File

@@ -4,12 +4,3 @@ set -e
echo -e "\e[32m\nUpdate system packages\e[0m"
sudo pacman -Syyu --noconfirm
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