* When ensuring sane $PWD in ebuild.sh, die if the `cd "$PORTAGE_BUILDDIR"`
authorZac Medico <zmedico@gentoo.org>
Sun, 5 Oct 2008 05:09:33 +0000 (05:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 5 Oct 2008 05:09:33 +0000 (05:09 -0000)
  call fails.
* Create $PORTAGE_BUILDDIR for the "fetch" phase too since it might be
  necessary to call pkg_nofetch.

svn path=/main/trunk/; revision=11628

bin/ebuild.sh
pym/portage/__init__.py

index 041d5fa4d7f817c4b90f7f2a7f7fd7b6db6a34cd..c274680f0b8153be580004eb9629b472ba336c87 100755 (executable)
@@ -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)
index 2a596fa86f64208317a5ae4612f034f0f7ebce4f..2cf46461eb0a817ee03752e428c07aaf6238b031 100644 (file)
@@ -5430,8 +5430,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
 
                # Build directory creation isn't required for any of these.
                have_build_dirs = False
-               if mydo not in ("clean", "cleanrm", "digest",
-                       "fetch", "help", "manifest"):
+               if mydo not in ("digest", "help", "manifest"):
                        mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
                        if mystatus:
                                return mystatus