summaryrefslogtreecommitdiffstats
path: root/.local/bin/upgrade
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/upgrade')
-rwxr-xr-x.local/bin/upgrade10
1 files changed, 10 insertions, 0 deletions
diff --git a/.local/bin/upgrade b/.local/bin/upgrade
index 9f658a5..8edae27 100755
--- a/.local/bin/upgrade
+++ b/.local/bin/upgrade
@@ -9,6 +9,16 @@ if (( ${#orphans[@]} )); then
sudo pacman -Rns "${orphans[@]}"
fi
+# Remove dropped packages
+mapfile -t foreign < <(pacman -Qmq)
+if (( ${#foreign[@]} )); then
+ mapfile -t dropped < \
+ <(expac '%n %p' "${foreign[@]}" | grep -v 'Justin Gassner' | cut -d' ' -f1)
+ if (( ${#dropped[@]} )); then
+ sudo pacman -Rns "${dropped[@]}"
+ fi
+fi
+
# Manage .pac* files
sudo pacdiff