test_merge_order: test hard blocker resolution
authorZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 03:49:08 +0000 (20:49 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 03:49:08 +0000 (20:49 -0700)
pym/_emerge/depgraph.py
pym/portage/tests/resolver/test_merge_order.py

index 4789a0ca2060dc477ea34494e36e659e6bef2288..3ef47f8abf380f1cd0af0a1becb9e5e6e67364fb 100644 (file)
@@ -5531,8 +5531,7 @@ class depgraph(object):
 
                                msg.append("\n")
 
-                       sys.stderr.write("".join(msg))
-                       sys.stderr.flush()
+                       writemsg("".join(msg), noiselevel=-1)
 
                if "--quiet" not in self._frozen_config.myopts:
                        show_blocker_docs_link()
index 6c929f729c53192d8c54fbd23a4dc253e289c8a1..e7f1aa48c05ff12773b39996f39cdf3a898f7369 100644 (file)
@@ -11,6 +11,7 @@ class MergeOrderTestCase(TestCase):
                ebuilds = {
                        "app-misc/blocker-buildtime-a-1" : {},
                        "app-misc/blocker-runtime-a-1" : {},
+                       "app-misc/blocker-runtime-hard-a-1" : {},
                        "app-misc/circ-post-runtime-a-1": {
                                "PDEPEND": "app-misc/circ-post-runtime-b",
                        },
@@ -24,8 +25,9 @@ class MergeOrderTestCase(TestCase):
                                "RDEPEND": "app-misc/circ-runtime-a",
                        },
                        "app-misc/installed-blocker-a-1" : {
+                               "EAPI"   : "2",
                                "DEPEND" : "!app-misc/blocker-buildtime-a",
-                               "RDEPEND" : "!app-misc/blocker-runtime-a",
+                               "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
                        },
                        "app-misc/some-app-a-1": {
                                "RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
@@ -37,9 +39,10 @@ class MergeOrderTestCase(TestCase):
 
                installed = {
                        "app-misc/installed-blocker-a-1" : {
+                               "EAPI"   : "2",
                                "DEPEND" : "!app-misc/blocker-buildtime-a",
-                               "RDEPEND" : "!app-misc/blocker-runtime-a",
-                       }
+                               "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a",
+                       },
                }
 
                test_cases = (
@@ -72,6 +75,13 @@ class MergeOrderTestCase(TestCase):
                                ["app-misc/blocker-runtime-a"],
                                success = True,
                                mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]),
+                       # An installed package has a hard runtime blocker that
+                       # will not resolve automatically (unless the option
+                       # requested in bug 250286 is implemented).
+                       ResolverPlaygroundTestCase(
+                               ["app-misc/blocker-runtime-hard-a"],
+                               success = False,
+                               mergelist = ['app-misc/blocker-runtime-hard-a-1', '!!app-misc/blocker-runtime-hard-a']),
                )
 
                playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)