dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit b6773fdea7ecef9eeda047f87fc06dc2134f3451
parent e0114948be58fe7f293c86619da3199c5bfae791
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon, 11 Mar 2019 09:33:52 +0100

Better handling of unused packages

Diffstat:
Mlinks/bin/uu | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/links/bin/uu b/links/bin/uu @@ -9,7 +9,16 @@ if [ "$(uname)" = "Linux" ]; then if type pacman >/dev/null; then sudo pacman -Syu --color auto echo "Removing unneeded packages" - pacman -Qdt --color auto + unused=$(pacman -Qdtq) + if [[ $(echo "$unused" | wc -l) -gt 1 ]]; then + echo "Unused packages:" + echo "$unused" + read -p "Delete unused packages? [y/N] " -n 1 -r + if [[ $REPLY =~ ^[Yy]$ ]]; then + sudo pacman -Rns $unused + fi + fi + echo "Removing old packages" sudo pacman -Sc --color auto fi