summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-26 19:12:04 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-26 19:12:04 +0000
commit7f254678851c439d085207fb6e7ddb7d5801de4a (patch)
treefd53cb670701a13a60b813a92ef2dfc85ce25f23 /pym
parentAdd some more clarification to the 'ebuild phase exited unexpectedly' message. (diff)
downloadportage-multirepo-7f254678851c439d085207fb6e7ddb7d5801de4a.tar.gz
portage-multirepo-7f254678851c439d085207fb6e7ddb7d5801de4a.tar.bz2
portage-multirepo-7f254678851c439d085207fb6e7ddb7d5801de4a.zip
Make Scheduler.merge() bail out early if PORTAGE_TMPDIR is not properly set.
svn path=/main/trunk/; revision=12103
Diffstat (limited to 'pym')
-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 2d7c05eb..e82269dd 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -9697,6 +9697,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"