From: Zac Medico Date: Fri, 10 Mar 2006 12:01:21 +0000 (-0000) Subject: Fix dyn_clean in ebuild.sh so that it removes the builddir correctly (if it is empty... X-Git-Tag: v2.1_pre6~7 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=cd219536929f24fa576848b920bae7dd6d2e223e;p=portage.git Fix dyn_clean in ebuild.sh so that it removes the builddir correctly (if it is empty). See bug #105706. svn path=/main/trunk/; revision=2840 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 810aa1d89..c4bc9bff5 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -763,12 +763,14 @@ dyn_clean() { find "${PORTAGE_BUILDDIR}" -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null fi - if [ -z "$(find "${PORTAGE_BUILDDIR}" -mindepth 1 -maxdepth 1)" ]; then - rmdir "${PORTAGE_BUILDDIR}" - fi # do not bind this to doebuild defined DISTDIR; don't trust doebuild, and if mistakes are made it'll # 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 + true }