This little script deletes all unreferenced distfiles (like portsclean -DD does on FreeBSD, and apt-get clean (I think) on Debian GNU/Linux). Feel free to include it in gentoolkit or whatever.
Created attachment 59549 [details] distclean.sh (rev. 1.4) Initial public "release".
There's a python implementation that works the same and is much faster. Check it out: http://www.stacken.kth.se/~foo/gentoo/files/distclean-0.2.py