diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-06-30 22:09:48 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-06-30 22:09:48 -0400 |
commit | 291a7cb95133288c400ef3853acfa012a451eb27 (patch) | |
tree | e2250696c02e28c0ab17d93636c48bb340575577 | |
parent | 43f1704d95a4af9eac0882195eb443e0e45d5724 (diff) |
packages.sh winston
-rwxr-xr-x | packages.sh (renamed from packages-diff.sh) | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages-diff.sh b/packages.sh index b60d81f..454e0e5 100755 --- a/packages-diff.sh +++ b/packages.sh @@ -1,6 +1,7 @@ #!/bin/bash -grps=($(sed -n -e 's/#.*//;s/^g://p' < packages.txt)) -pkgs=($(sed -n -e 's/#.*//;s/^p://p' < packages.txt)) +all=($(< packages.txt sed 's/#.*//' | xargs printf -- '%s\n' | sort -u)) +grps=($(printf -- '%s\n' "${all[@]}" | sed -n 's/^g://p')) +pkgs=($(printf -- '%s\n' "${all[@]}" | sed -n 's/^p://p')) echo ' => In packages.txt, but not installed' comm -13 \ @@ -14,5 +15,11 @@ comm -23 \ <({ pacman -Qgq -- "${grps[@]}"; printf '%s\n' "${pkgs[@]}"; }|sort -u) | sed 's|^| -> |' +echo ' => Installed as dependencies, but only optionally needed' +comm -23 \ + <(pacman -Qdttq|sort -u) \ + <(pacman -Qdtq |sort -u) | +sed 's|^| -> |' + echo ' => Installed as dependencies, but no longer needed' pacman -Qdtq|sort -u |sed 's|^| -> |' |