diff options
-rwxr-xr-x | bin/ebuild.sh | 7 |
1 files 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 } |