From: Zac Medico Date: Sun, 5 Oct 2008 16:31:26 +0000 (-0000) Subject: In dyn_clean, cd to $PORTAGE_BUILDDIR/.. before attempting to remove it since X-Git-Tag: v2.2_rc12~28 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1640da21752b8a2eccf860cdbc5898128e0fe4b4;p=portage.git In dyn_clean, cd to $PORTAGE_BUILDDIR/.. before attempting to remove it since some kernels, such as Solaris, return EINVAL when an attempt is made to remove the current working directory. Thanks to Fabian Groffen for reporting. svn path=/main/trunk/; revision=11630 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index c274680f0..8ee27fc93 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -751,9 +751,10 @@ dyn_clean() { # result in it wiping the users distfiles directory (bad). rm -rf "${PORTAGE_BUILDDIR}/distdir" - if [ -z "$(find "${PORTAGE_BUILDDIR}" -mindepth 1 -maxdepth 1)" ]; then - rmdir "${PORTAGE_BUILDDIR}" - fi + # Some kernels, such as Solaris, return EINVAL when an attempt + # is made to remove the current working directory. + cd "$PORTAGE_BUILDDIR"/.. + rmdir "$PORTAGE_BUILDDIR" 2>/dev/null true }