Fix dyn_clean in ebuild.sh so that it removes the builddir correctly (if it is empty...
authorZac Medico <zmedico@gentoo.org>
Fri, 10 Mar 2006 12:01:21 +0000 (12:01 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 10 Mar 2006 12:01:21 +0000 (12:01 -0000)
svn path=/main/trunk/; revision=2840

bin/ebuild.sh

index 810aa1d899b8a2d753f520fe51804fd19837b83d..c4bc9bff5fcb24de6521eb6d714b3c7c5d542e46 100755 (executable)
@@ -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
 }