summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-18 02:28:55 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-18 02:28:55 -0700
commitfd309031cea3bab8d024737375501f2df9c3c2bf (patch)
treef25c444d1ac8356908b4bbf236acc52ae27fcf62
parent6783d61bb66371bf1be62b55a19d1b954b54418c (diff)
downloadportage-fd309031cea3bab8d024737375501f2df9c3c2bf.tar.gz
portage-fd309031cea3bab8d024737375501f2df9c3c2bf.tar.bz2
portage-fd309031cea3bab8d024737375501f2df9c3c2bf.zip
Bug #337826 - Fix spawn_nofetch() to create the private
PORTAGE_TMPDIR before calling doebuild_environment().
-rw-r--r--pym/portage/package/ebuild/_spawn_nofetch.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/pym/portage/package/ebuild/_spawn_nofetch.py b/pym/portage/package/ebuild/_spawn_nofetch.py
index b68c94a54..175d88bd1 100644
--- a/pym/portage/package/ebuild/_spawn_nofetch.py
+++ b/pym/portage/package/ebuild/_spawn_nofetch.py
@@ -45,19 +45,9 @@ def spawn_nofetch(portdb, ebuild_path, settings=None):
if 'PORTAGE_PARALLEL_FETCHONLY' in settings:
return
- doebuild_environment(ebuild_path, 'nofetch',
- settings=settings, db=portdb)
- restrict = settings['PORTAGE_RESTRICT'].split()
- defined_phases = settings['DEFINED_PHASES'].split()
- if not defined_phases:
- # When DEFINED_PHASES is undefined, assume all
- # phases are defined.
- defined_phases = EBUILD_PHASES
-
- if 'fetch' not in restrict and \
- 'nofetch' not in defined_phases:
- return
-
+ # We must create our private PORTAGE_TMPDIR before calling
+ # doebuild_environment(), since lots of variables such
+ # as PORTAGE_BUILDDIR refer to paths inside PORTAGE_TMPDIR.
portage_tmpdir = settings.get('PORTAGE_TMPDIR')
if not portage_tmpdir or not os.access(portage_tmpdir, os.W_OK):
portage_tmpdir = None
@@ -66,6 +56,19 @@ def spawn_nofetch(portdb, ebuild_path, settings=None):
settings.backup_changes('PORTAGE_TMPDIR')
try:
+ doebuild_environment(ebuild_path, 'nofetch',
+ settings=settings, db=portdb)
+ restrict = settings['PORTAGE_RESTRICT'].split()
+ defined_phases = settings['DEFINED_PHASES'].split()
+ if not defined_phases:
+ # When DEFINED_PHASES is undefined, assume all
+ # phases are defined.
+ defined_phases = EBUILD_PHASES
+
+ if 'fetch' not in restrict and \
+ 'nofetch' not in defined_phases:
+ return
+
prepare_build_dirs(settings=settings)
ebuild_phase = EbuildPhase(background=False,
phase='nofetch', scheduler=PollScheduler().sched_iface,