1) portage-2.0.51_rc9.ebuild (l. 298-300): if has ccache $FEATURES && has userpriv $FEATURES; then chown -R portage:portage /var/tmp/ccache &>/dev/null chmod -R g+rws /var/tmp/ccache &>/dev/null it doesn't work with userpriv in FEATURES and CCACHE_DIR set to a different directory, so s|/var/tmp/ccache|${CCACHE_DIR:-/var/tmp/ccache}| In the latest version CCACHE_DIR is set at this point. The expansion should not be needed. 2) Then there is the check for the possible distfiles directories: ${ROOT}usr/portage/distfiles and ${ROOT}/${PORTDIR}/distfiles I think it should be: ${ROOT}usr/portage/distfiles and ${ROOT}/${DISTDIR} If DISTDIR is set in make.conf it can be different from the first two dirs. But ${ROOT}/${PORTDIR}/distfiles should never be needed, because if nothing is changed then DISTDIR=${ROOT}usr/porage/distfiles, if PORTDIR is changed in /etc/make.conf then DISTDIR is still ${ROOT}usr/portage/distfiles.
The portage ebuild no longer does this bad stuff.