Crude hack to solve
authorFabian Groffen <grobian@gentoo.org>
Sun, 28 Sep 2008 10:54:48 +0000 (10:54 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 28 Sep 2008 10:54:48 +0000 (10:54 -0000)
  rmdir .../var/tmp/binpkgs/cat/pkg-ver: Invalid argument
and alike for var/tmp/portage/... on Solaris.

rmtree(2) returns EINVAL on Solaris if the argument (the dir to remove)
is the current directory, or the argument ends with '.'.  Since we cd to
PORTAGE_BUILDDIR we indeed cannot remove it anymore on Solaris.  Hence,
we now try to go to the parent of this dir, but ultimately a better
solution should be found.

svn path=/main/branches/prefix/; revision=11577

bin/ebuild.sh

index 27f579d010dffa51ac86d1f180e90369f275c07e..f039b1d8a7982b5ba6b348c6181b48489ba39bc4 100755 (executable)
@@ -273,7 +273,7 @@ register_die_hook() {
 }
 
 # Ensure that $PWD is sane whenever possible.
-cd "$PORTAGE_BUILDDIR" 2>/dev/null
+cd "${PORTAGE_BUILDDIR}"/.. 2>/dev/null
 
 #if no perms are specified, dirs/files will have decent defaults
 #(not secretive, but not stupid)