From 242006933d31c88b844f8f8d0c2f0806763cc51f Mon Sep 17 00:00:00 2001 From: Eric Bélanger Date: Thu, 16 Feb 2012 00:56:29 -0500 Subject: pacsysclean: Fix script description and accept -o option without hyphen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close FS#28434 Signed-off-by: Eric Bélanger Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- contrib/pacsysclean.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/pacsysclean.in b/contrib/pacsysclean.in index c87082e0..a4accd56 100755 --- a/contrib/pacsysclean.in +++ b/contrib/pacsysclean.in @@ -1,11 +1,11 @@ #!/bin/bash -# pacsysclean - Sort installed packages by decreasing installed size. Useful for system clean-up. +# pacsysclean - Sort installed packages by increasing installed size. Useful for system clean-up. PACMAN_OPTS= usage() { - echo "pacsysclean - Sort installed packages by decreasing installed size." + echo "pacsysclean - Sort installed packages by increasing installed size." echo echo "Usage: pacsysclean [options]" echo @@ -26,6 +26,9 @@ fi IFS=$'\n' name="^Name.*: (.*)$" size="^Installed Size.*: (.*) KiB$" + +[[ $PACMAN_OPTS != -* ]] && PACMAN_OPTS="-$PACMAN_OPTS" + for line in $(LANG=C pacman -Qi $PACMAN_OPTS); do if [[ $line =~ $name ]]; then printf "%s\t" ${BASH_REMATCH[1]} -- cgit v1.2.3-24-g4f1b