[pacman-dev] [PATCH] pacsysclean: Fix script description and accept -o option without hyphen
Eric Bélanger
snowmaniscool at gmail.com
Thu Feb 16 00:56:29 EST 2012
Close FS#28434
Signed-off-by: Eric Bélanger <snowmaniscool at gmail.com>
---
contrib/pacsysclean.in | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/contrib/pacsysclean.in b/contrib/pacsysclean.in
index 17f7681..162530e 100755
--- a/contrib/pacsysclean.in
+++ b/contrib/pacsysclean.in
@@ -1,6 +1,6 @@
#!/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.
declare -r myname='pacsysclean'
declare -r myver='@PACKAGE_VERSION@'
@@ -8,7 +8,7 @@ declare -r myver='@PACKAGE_VERSION@'
PACMAN_OPTS=
usage() {
- echo "$myname - Sort installed packages by decreasing installed size."
+ echo "$myname - Sort installed packages by increasing installed size."
echo
echo "Usage: $myname [options]"
echo
@@ -35,6 +35,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]}
--
1.7.9.1
More information about the pacman-dev
mailing list