summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-30 19:46:41 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-30 19:46:41 +0000
commitb382d5ff6f7226e711f4d07528b78b7ac0dc3228 (patch)
treebab422ff7c60d09f2b2b52cfe517ee3475237d17
parent0096e7682c1d116cc7733f9b61245481965da2d1 (diff)
downloadportage-b382d5ff6f7226e711f4d07528b78b7ac0dc3228.tar.gz
portage-b382d5ff6f7226e711f4d07528b78b7ac0dc3228.tar.bz2
portage-b382d5ff6f7226e711f4d07528b78b7ac0dc3228.zip
Bug #264291 - Fix inappropriate build dir creation for emerge --fetchonly.
svn path=/main/trunk/; revision=13252
-rw-r--r--pym/_emerge/__init__.py2
-rw-r--r--pym/portage/__init__.py8
2 files changed, 7 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 3facb56e6..2f28b4e17 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -1788,8 +1788,6 @@ class EbuildFetchonly(SlotObject):
portdb = root_config.trees["porttree"].dbapi
ebuild_path = portdb.findname(pkg.cpv)
debug = settings.get("PORTAGE_DEBUG") == "1"
- portage.prepare_build_dirs(self.pkg.root, self.settings, 0)
-
retval = portage.doebuild(ebuild_path, "fetch",
self.settings["ROOT"], self.settings, debug=debug,
listonly=self.pretend, fetchonly=1, fetchall=self.fetch_all,
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index e2328edab..919b2108b 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -5841,6 +5841,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
logfile=None, returnpid=returnpid)
return retval
+ restrict = set(mysettings.get('PORTAGE_RESTRICT', '').split())
# get possible slot information from the deps file
if mydo == "depend":
writemsg("!!! DEBUG: dbkey: %s\n" % str(dbkey), 2)
@@ -5949,8 +5950,13 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
mysettings["PF"], myroot, mysettings, vartree=vartree)
# Build directory creation isn't required for any of these.
+ # In the fetch phase, the directory is needed only for RESTRICT=fetch
+ # in order to satisfy the sane $PWD requirement (from bug #239560)
+ # when pkg_nofetch is spawned.
have_build_dirs = False
- if not parallel_fetchonly and mydo not in ("digest", "help", "manifest"):
+ if not parallel_fetchonly and \
+ mydo not in ('digest', 'help', 'manifest') and \
+ not (mydo == 'fetch' and 'fetch' not in restrict):
mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
if mystatus:
return mystatus