summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-09-26 18:36:32 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-09-26 18:36:32 -0400
commit43f1704d95a4af9eac0882195eb443e0e45d5724 (patch)
treeb9acae2b162481e525012692fb89c0fab49f5847
packages-diff.sh proton
-rwxr-xr-xpackages-diff.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages-diff.sh b/packages-diff.sh
new file mode 100755
index 0000000..b60d81f
--- /dev/null
+++ b/packages-diff.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+grps=($(sed -n -e 's/#.*//;s/^g://p' < packages.txt))
+pkgs=($(sed -n -e 's/#.*//;s/^p://p' < packages.txt))
+
+echo ' => In packages.txt, but not installed'
+comm -13 \
+ <(pacman -Qq|sort -u) \
+ <({ pacman -Qgq -- "${grps[@]}"; printf '%s\n' "${pkgs[@]}"; }|sort -u) |
+sed 's|^| -> |'
+
+echo ' => Installed explicitly, but not in packages.txt'
+comm -23 \
+ <(pacman -Qetq|sort -u) \
+ <({ pacman -Qgq -- "${grps[@]}"; printf '%s\n' "${pkgs[@]}"; }|sort -u) |
+sed 's|^| -> |'
+
+echo ' => Installed as dependencies, but no longer needed'
+pacman -Qdtq|sort -u |sed 's|^| -> |'