summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-10-05 16:31:26 +0000
committerZac Medico <zmedico@gentoo.org>2008-10-05 16:31:26 +0000
commit1640da21752b8a2eccf860cdbc5898128e0fe4b4 (patch)
tree87e63833310b175e515baa573aaf806ee4dac8e6 /bin
parent55b3150af635a418ba3f1424132359c894db7ec4 (diff)
downloadportage-1640da21752b8a2eccf860cdbc5898128e0fe4b4.tar.gz
portage-1640da21752b8a2eccf860cdbc5898128e0fe4b4.tar.bz2
portage-1640da21752b8a2eccf860cdbc5898128e0fe4b4.zip
In dyn_clean, cd to $PORTAGE_BUILDDIR/.. before attempting to remove it since
some kernels, such as Solaris, return EINVAL when an attempt is made to remove the current working directory. Thanks to Fabian Groffen <grobian@g.o> for reporting. svn path=/main/trunk/; revision=11630
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh7
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
}