#!/bin/sh

OKLIST="a2ps
        abiword
	acidbase
	advi
	agistudio
	aide
	alexandria
	amavis
	amule
	am-utils
	analog
	anjuta
	annoyance-filter
	ant
	apache
	apache2
	apcalc
	apsfilter
	aptitude
	ardour
	armagetron
	aspell
	aspseek
	atlas2
	atlas3
	auctex
        audacity
	autobook
	autoclass
	autoconf2.13
	autoconf
	autoinstall
	automake1.7
	automake1.8
	automake1.9
	awstats
	backuppc
	bacula
	balsa
	bash
	bastille
	bb
	bbdb
	beep
	beneath
	billard
	bioperl
	bison
	binutils
	blender
	blt
	bluefish
	bochs
	brickos
	bugsx
	bugzilla
	capplets
	cdbs
	cdd-doc
	cdrecord
	cfengine
	cfengine2
	classpath
	console
	coreutils
	cpp
	ctn
	ctsim
	cupsys
	dbconfig-common
	debhelper
	debtags
	debtags-edit
	desktop
        dosemu
	dpkg
	e2fsprogs
	egroupware
	emacs21
	festival
	fetchmail
	fftw3
	findutils
	flashplayer
	foomatic
	g++
	gcc
	gdb
	gdm
	ghemical
	gimp
        gnome
	gnulib
	gnumed-client
	gnumed-plugincommon
        gnumeric
	grip
	groff
	groff-base
	grub
	gsfonts
	k3b
	kaffe
	kdelibs
	konqueror
	lapack
	login
	lsof
        man
	menu
	mkisofs
	mplayer
	multi
        openoffice.org
        passwd
        php4
	prosper
	pymol
        python
	slang1
	ssh
        synaptic
        w3m
	wdg
	xmms
	xpdf
        xplanet
	xprt
        zope"
rawlist="/tmp/bigraw"
biglist="/tmp/pkglist"
rm -f $biglist

find . -size +300k -printf "%f#%b\n" | sort | \
     sed -e "s/_[0-9%a+.]\+[-.][-.0-9a-v%+]*-[.0-9a-z]\+_[ia].*\.deb//" \
	 -e "s/_[.0-9a-zA-Z]\+[-+][-.0-9+a-zA-Z]\+_[ali386]\{3,4\}.deb//" \
         -e "s/_[.0-9+]\+_[ali386]\{3,4\}.deb//" | \
cat > $rawlist

for pkgsize in `grep -v "^lib" $rawlist | grep -v kde` ; do 
   pkg=`echo $pkgsize | sed "s/#.*//"`
   if echo $OKLIST | grep -q "`echo $pkg | sed "s/[-_].*//"`" ; then continue ; fi
   size=`echo $pkgsize | sed "s/.*#//"`
   echo "$pkg: $size"  >> $biglist
   apt-cache --no-all-versions show $pkg | grep -A3 "^Description:" >> $biglist
   echo . >> $biglist
done

rm -f $rawlist

[ -s $biglist ] && less $biglist

