Fix --resume mode to check for unsatisfied blockers and bail out when
authorZac Medico <zmedico@gentoo.org>
Sat, 3 May 2008 02:14:08 +0000 (02:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 3 May 2008 02:14:08 +0000 (02:14 -0000)
necessary.

svn path=/main/trunk/; revision=10115

pym/_emerge/__init__.py

index e1b07860236bfd17daa8aeb65f248ba8fdc56753..61c4aed7d7cefbdc34b4c7e653fc1cbf113070e1 100644 (file)
@@ -7637,6 +7637,10 @@ def action_build(settings, trees, mtimedb,
                        mysettings.lock()
                        del myroot, mysettings
 
+               favorites = mtimedb["resume"].get("favorites")
+               if not isinstance(favorites, list):
+                       favorites = []
+
                # "myopts" is a list for backward compatibility.
                resume_opts = mtimedb["resume"].get("myopts", [])
                if isinstance(resume_opts, list):
@@ -7664,6 +7668,21 @@ def action_build(settings, trees, mtimedb,
                if show_spinner:
                        print "\b\b... done!"
 
+               if success:
+                       mymergelist = mydepgraph.altlist()
+                       if mymergelist and \
+                               (isinstance(mymergelist[-1], Blocker) and \
+                               not mymergelist[-1].satisfied):
+                               if not fetchonly and not pretend:
+                                       mydepgraph.display(
+                                               mydepgraph.altlist(reversed=tree),
+                                               favorites=favorites)
+                                       print "\n!!! Error: The above package list contains packages which cannot be installed"
+                                       print   "!!!        at the same time on the same system."
+                                       if not quiet:
+                                               show_blocker_docs_link()
+                                       return 1
+
                if not success:
                        mydepgraph.display_problems()