ResolverPlayground: distinguish uninstall merge
authorZac Medico <zmedico@gentoo.org>
Wed, 20 Jun 2012 10:05:26 +0000 (03:05 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 20 Jun 2012 10:05:26 +0000 (03:05 -0700)
pym/portage/tests/resolver/ResolverPlayground.py
pym/portage/tests/resolver/test_merge_order.py

index 8c806c74b4f5de21d8d99f03a1d78cbe36b01e11..0476ed4dd4270de470327f2e08748d348520cb61 100644 (file)
@@ -746,8 +746,12 @@ class ResolverPlaygroundResult(object):
                                        if x.metadata["repository"] != "test_repo":
                                                repo_str = _repo_separator + x.metadata["repository"]
                                        mergelist_str = x.cpv + repo_str
-                                       if x.type_name == "binary":
-                                               mergelist_str = "[binary]" + mergelist_str
+                                       if x.built:
+                                               if x.operation == "merge":
+                                                       desc = x.type_name
+                                               else:
+                                                       desc = x.operation
+                                               mergelist_str = "[%s]%s" % (desc, mergelist_str)
                                        self.mergelist.append(mergelist_str)
 
                if self.depgraph._dynamic_config._needed_use_config_changes:
index adff84d2bf0294d10987733d50cbc13578f2b428..5b5709afe174bbd2caafca6864702f3647f864bf 100644 (file)
@@ -376,7 +376,7 @@ class MergeOrderTestCase(TestCase):
                                success = True,
                                all_permutations = True,
                                ambiguous_merge_order = True,
-                               mergelist = [("app-misc/blocker-runtime-a-1", "app-misc/blocker-runtime-b-1"), "app-misc/installed-blocker-a-1", ("!app-misc/blocker-runtime-a", "!app-misc/blocker-runtime-b")]),
+                               mergelist = [("app-misc/blocker-runtime-a-1", "app-misc/blocker-runtime-b-1"), "[uninstall]app-misc/installed-blocker-a-1", ("!app-misc/blocker-runtime-a", "!app-misc/blocker-runtime-b")]),
                        # We have a soft buildtime blocker against an installed
                        # package that should cause it to be uninstalled. Note that with
                        # soft blockers, the blocking packages are allowed to temporarily
@@ -386,7 +386,7 @@ class MergeOrderTestCase(TestCase):
                        ResolverPlaygroundTestCase(
                                ["app-misc/blocker-buildtime-unbuilt-a"],
                                success = True,
-                               mergelist = ["app-misc/blocker-buildtime-unbuilt-a-1", "app-misc/installed-blocker-a-1", "!app-misc/installed-blocker-a"]),
+                               mergelist = ["app-misc/blocker-buildtime-unbuilt-a-1", "[uninstall]app-misc/installed-blocker-a-1", "!app-misc/installed-blocker-a"]),
                        # We have a hard buildtime blocker against an installed
                        # package that will not resolve automatically (unless
                        # the option requested in bug 250286 is implemented).
@@ -409,7 +409,7 @@ class MergeOrderTestCase(TestCase):
                        ResolverPlaygroundTestCase(
                                ["media-video/libav"],
                                success=True,
-                               mergelist = ['media-video/libav-0.7_pre20110327', 'media-video/ffmpeg-0.7_rc1', '!media-video/ffmpeg']),
+                               mergelist = ['media-video/libav-0.7_pre20110327', '[uninstall]media-video/ffmpeg-0.7_rc1', '!media-video/ffmpeg']),
                        # Test that OS_HEADERS_PACKAGE_ATOM and LIBC_PACKAGE_ATOM
                        # are merged asap, in order to account for implicit
                        # dependencies. See bug #303567. Optimally, satisfied deps