At the end of dyn_clean(), also remove the $CATEGORY directory if possible. v2.2_rc12
authorZac Medico <zmedico@gentoo.org>
Thu, 9 Oct 2008 20:31:04 +0000 (20:31 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 9 Oct 2008 20:31:04 +0000 (20:31 -0000)
svn path=/main/trunk/; revision=11667

bin/ebuild.sh

index b501e94a258c07e9b81c652718e91d1c517066b0..92b635c3ab516c9b5ed1ea16af8d0731c0805c7d 100755 (executable)
@@ -753,8 +753,8 @@ dyn_clean() {
 
        # 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
+       cd "$PORTAGE_BUILDDIR"/../..
+       rmdir "$PORTAGE_BUILDDIR" "${PORTAGE_BUILDDIR%/*}" 2>/dev/null
 
        true
 }