File: popcon-largest-unused

package info (click to toggle)
popularity-contest 1.41
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 440 kB
  • ctags: 78
  • sloc: perl: 858; python: 299; sh: 209; makefile: 41
file content (18 lines) | stat: -rwxr-xr-x 540 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# Author: Yann Dirson <dirson@debian.org>
# License: GPL

datafile=/var/log/popularity-contest

if [ ! -e $datafile ] ; then
    echo "warning: Missing required file $datafile."
    echo "info:    Run 'popularity-contest > $datafile' to generate it."
    exit 1
fi

grep '<OLD>' $datafile | cut -d' ' -f3 |
  xargs apt-cache -o 'APT::Cache::AllVersions=0' show |
  grep -E '^(Package|Installed-Size): ' |
  perl -ne 'if (/^Package: (.*)/) { $p = $1 };  if (/^Installed-Size: (.*)/) { print "$1 $p\n"; $p = 'BUG' }' |
  sort -rn