I just changed my portage directories to a non-standard setup on different partitions (see below), and yacleaner and distcleaner no longer worked no matter what I tried (editing the script files). Even ecleaner didn't work- I killed it after 15 minutes. Finally (after a lot of struggling), I saw vicaya's amazing one line perl solution above, and it worked flawlessly! I just did a cd /mnt/dump/distfiles as root, and copy/pasted it in at the prompt. Went from 405 to 354 distfiles in about 2 minutes. I was a little apprehensive (as I don't understand perl), but after reading thrope's great explanation, I went ahead.
BTW, I followed the info on this Gentoo doc page
http://www.gentoo.org/doc/en/articles/p ... ing-p2.xml, so now my portage tree is on it's own partition /mnt/portage (ext2 with dir_index), /var & /tmp are on theirs (/mnt/rwstorage, with dir_index and data=writeback) with / symlinks, and distfiles is on another tuned ext3, "/mnt/dump" with no /usr/portage symlink- just the make.conf edit. Also had to make a new /etc/make.profile symlink to /mnt/portage/profiles/default-linux/x86/2005.1.
This setup is working very well and performance is outstanding.
-------------------------------------------------------------------------------------------------
# Portage Directories
# ===================
#
# Each of these settings controls an aspect of portage's storage and file
# system usage. If you change any of these, be sure it is available when
# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" ***
#
# PORTAGE_TMPDIR is the location portage will use for compilations and
# temporary storage of data. This can get VERY large depending upon
# the application being installed.
PORTAGE_TMPDIR=/mnt/rwstorage/var/tmp
#
# PORTDIR is the location of the portage tree. This is the repository
# for all profile information as well as all ebuilds. This directory
# itself can reach 200M. WE DO NOT RECOMMEND that you change this.
PORTDIR=/mnt/portage
#
# DISTDIR is where all of the source code tarballs will be placed for
# emerges. The source code is maintained here unless you delete
# it. The entire repository of tarballs for gentoo is 9G. This is
# considerably more than any user will ever download. 2-3G is
# a large DISTDIR.
DISTDIR=/mnt/dump/distfiles
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can get
# upto several hundred megs, or even a few gigs.
PKGDIR=/mnt/portage/packages
#
# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without
# concern that they will be deleted by rsync updates. Default is not
# defined.
PORTDIR_OVERLAY=/usr/local/portage
#
# PORT_LOGDIR is the location where portage will store all the logs it
# creates from each individual merge. They are stored as YYMMDD-$PF.log
# in the directory specified. This is disabled until you enable it by
# providing a directory. Permissions will be modified as needed IF the
# directory exists, otherwise logging will be disabled.
PORT_LOGDIR=/mnt/rwstorage/var/log/portage