From 1640da21752b8a2eccf860cdbc5898128e0fe4b4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 5 Oct 2008 16:31:26 +0000 Subject: 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 --- bin/ebuild.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 } -- cgit v1.2.3-1-g7c22