summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 041d5fa4d..c274680f0 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -273,7 +273,10 @@ register_die_hook() {
}
# Ensure that $PWD is sane whenever possible.
-cd "$PORTAGE_BUILDDIR" 2>/dev/null
+if ! hasq "$EBUILD_PHASE" clean depend help ; then
+ cd "$PORTAGE_BUILDDIR" || \
+ die "PORTAGE_BUILDDIR does not exist: '$PORTAGE_BUILDDIR'"
+fi
#if no perms are specified, dirs/files will have decent defaults
#(not secretive, but not stupid)