The code in question: if [ -d "${ROOT}usr/portage/distfiles" ]; then chown -R root:portage "${ROOT}usr/portage/distfiles" chmod 0664 "${ROOT}usr/portage/distfiles"/* find "${ROOT}usr/portage/distfiles" -type f -maxdepth 1 -print0 | \ ${XARGS} -0 -n 500 chmod 0644 chmod 2775 "${ROOT}usr/portage/distfiles" chmod 2775 "${ROOT}usr/portage/distfiles/cvs-src" fi if [ -d "${ROOT}/${PORTDIR}/distfiles" ]; then chown -R root:portage "${ROOT}/${PORTDIR}/distfiles" find "${ROOT}/${PORTDIR}/distfiles" -type f -maxdepth 1 -print0 | \ ${XARGS} -0 -n 500 chmod 0644 chmod 2775 "${ROOT}/${PORTDIR}/distfiles" chmod 2775 "${ROOT}/${PORTDIR}/distfiles/cvs-src" fi chown -R root:portage ${ROOT}var/cache/edb find ${ROOT}var/cache/edb -type f -print0 | ${XARGS} -0 -n 500 chmod 664 The problem: $DISTDIR is mounted via smbfs and the chmod does not carry though. The fix: Either put a &>/dev/null on each chmod or test for network filesystems.
Blah. Fixed and committed.