summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-26 19:13:23 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-26 19:13:23 +0000
commitcf045e992c5989fd6b9ac786d7c21884002d6074 (patch)
treed34beb4f9c513b2751357108e5e7064dcf76000a
parent9c0b1c25f8f3cf0ffdc841c9eb47a81b9d4568d7 (diff)
downloadportage-cf045e992c5989fd6b9ac786d7c21884002d6074.tar.gz
portage-cf045e992c5989fd6b9ac786d7c21884002d6074.tar.bz2
portage-cf045e992c5989fd6b9ac786d7c21884002d6074.zip
Make Scheduler.merge() bail out early if PORTAGE_TMPDIR is not properly set.
(trunk r12103) svn path=/main/branches/2.1.6/; revision=12104
-rw-r--r--pym/_emerge/__init__.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index f2209667a..8c3a89d49 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -9681,6 +9681,22 @@ class Scheduler(PollScheduler):
for root in self.trees:
root_config = self.trees[root]["root_config"]
+
+ # Even for --pretend --fetch mode, PORTAGE_TMPDIR is required
+ # since it might spawn pkg_nofetch which requires PORTAGE_BUILDDIR
+ # for ensuring sane $PWD (bug #239560) and storing elog messages.
+ tmpdir = root_config.settings.get("PORTAGE_TMPDIR", "")
+ if not tmpdir or not os.path.isdir(tmpdir):
+ msg = "The directory specified in your " + \
+ "PORTAGE_TMPDIR variable, '%s', " % tmpdir + \
+ "does not exist. Please create this " + \
+ "directory or correct your PORTAGE_TMPDIR setting."
+ msg = textwrap.wrap(msg, 70)
+ out = portage.output.EOutput()
+ for l in msg:
+ out.eerror(l)
+ return 1
+
if self._background:
root_config.settings.unlock()
root_config.settings["PORTAGE_BACKGROUND"] = "1"