diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-12-31 17:29:39 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2012-12-31 17:29:39 -0300 |
commit | 6f102d1647580e0bb9513c124b26a64c77da4f15 (patch) | |
tree | 0340f1f588be251183fe2b251bdba778f2c85c22 /pcr/pactools/pt-pacman-info | |
parent | 433900b14f11dc9ee55b72e8e5946bf47f65b636 (diff) | |
parent | b6cb10de275cea63bab0bee2a98342afa4fdc4ee (diff) | |
download | abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.tar.gz abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.tar.bz2 abslibre-6f102d1647580e0bb9513c124b26a64c77da4f15.zip |
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
Diffstat (limited to 'pcr/pactools/pt-pacman-info')
-rw-r--r-- | pcr/pactools/pt-pacman-info | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/pcr/pactools/pt-pacman-info b/pcr/pactools/pt-pacman-info new file mode 100644 index 000000000..c2c82f219 --- /dev/null +++ b/pcr/pactools/pt-pacman-info @@ -0,0 +1,77 @@ +#!/bin/sh +# pacman-info +# /usr/bin/pacman-info +# GPL v2 +# neonskull [at] gmail.com + +VERSION="0.1" +AUTHOR="Pável Varela Rodríguez [aka NeOnsKuLL]" + +usage() +{ +echo "pacman-info v$VERSION" +echo "usage: `basename $0` [OPTION] + +OPTIONS: + -cr|--configured-repos List the names of configured repos in your + pacman.conf + + -a|--all Calculates the total number of available + packages in your repos + + -br|--by-repo Calculates the total number of available + packages in each repo + + -i|--installed Calculates the number of installed packages + + -f|--full Generates a full Report + + -h|--help Show this message + + -v|--version Show version +" +} + +[ "$#" -lt 1 ] && PARAM="-h"; +[ "$#" -gt 1 ] && PARAM="*"; +[ "$#" -eq 1 ] && PARAM="$1"; + +case $PARAM in + "-a"|"--all") + echo -e "Repositories information (total of packages in repos): `pacman -Sl|wc -l`" + ;; + "-cr"|"--configured-repos") + echo "Repositories information (name of configured repos):" + pacman -Sl|awk '{print $1}'|cut -d"/" -f 2|uniq -c|awk '{print "* " $2}' + ;; + "-br"|"--by-repo") + echo "Repositories information (number of packages by repo):" + pacman -Sl|awk '{print $1}'|cut -d"/" -f 2|uniq -c|awk '{print ":: "$2 "\t-> " $1 "\tpkgs"}' + ;; + "-i"|"--installed") + echo -e "System information (total of installed packages): `pacman -Q|wc -l`" + ;; + "-f"|"--full") + echo -e "Full Report about Repositories and Packages for Archlinux" + echo -e "Node name: `uname -n`\n" + $0 -cr + echo + $0 -a + echo + $0 -br + echo + $0 -i + echo + echo -e "Generated using `$0 -v` by $AUTHOR" + ;; + "-h"|"--help") + usage + ;; + "-v"|"--version") + echo "`basename $0` v$VERSION" + ;; + *) + echo "Error! Unknown parameter." + usage + ;; +esac |