Make Scheduler.merge() bail out early if PORTAGE_TMPDIR is not properly set.
authorZac Medico <zmedico@gentoo.org>
Wed, 26 Nov 2008 19:13:23 +0000 (19:13 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 26 Nov 2008 19:13:23 +0000 (19:13 -0000)
(trunk r12103)

svn path=/main/branches/2.1.6/; revision=12104

pym/_emerge/__init__.py

index f2209667a4fca91e49ed1b527b25106cd9dd479f..8c3a89d49910a63e80d4339a29bcea8929c97395 100644 (file)
@@ -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"