diff options
-rwxr-xr-x | packages-diff.sh | 18 |
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|^| -> |' |