From cd219536929f24fa576848b920bae7dd6d2e223e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 10 Mar 2006 12:01:21 +0000 Subject: 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 --- bin/ebuild.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin') 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 } -- cgit v1.2.3-1-g7c22