diff options
Diffstat (limited to 'pcr/pactools/pt-pacsize')
-rw-r--r-- | pcr/pactools/pt-pacsize | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pcr/pactools/pt-pacsize b/pcr/pactools/pt-pacsize new file mode 100644 index 000000000..e70a34597 --- /dev/null +++ b/pcr/pactools/pt-pacsize @@ -0,0 +1,21 @@ +#!/bin/bash + +##AUTHOR: hads +##See: http://bbs.archlinux.org/viewtopic.php?t=20971 + +for i in /var/lib/pacman/local/*; do + PKG=`echo $i | cut -d '/' -f 6` + SIZE=`grep -A 1 SIZE $i/desc | tail -1` + if [ -x /usr/bin/bc ]; then + if [ $SIZE -gt 1024 ]; then + if [ $SIZE -gt 1048576 ]; then + SIZE=`echo "scale=1;$SIZE/1048576" | bc`M + else + SIZE=`echo "scale=1;$SIZE/1024" | bc`K + fi + else + SIZE={$SIZE}B + fi + fi + echo "$PKG | $SIZE" +done |