Fix a missing rebuild
authorSebastian Luther <SebastianLuther@gmx.de>
Tue, 26 Nov 2013 20:06:23 +0000 (21:06 +0100)
committerMike Frysinger <vapier@gentoo.org>
Wed, 27 Nov 2013 07:44:29 +0000 (02:44 -0500)
The dependency in the ebuild was changed from
slot operator to no slot operator. The vdb
contained the slot operator and emerge would
refuse to rebuild, causing a missed update.

URL: https://bugs.gentoo.org/490362

pym/_emerge/depgraph.py
pym/portage/tests/resolver/test_slot_conflict_rebuild.py

index 033057b9af0322d83f13704b9627943b9bdd0eee..da2e60422f8e086fb9e6e3d475093f089c3eddff 100644 (file)
@@ -1301,8 +1301,7 @@ class depgraph(object):
                        selected_atoms = None
 
                        for atom in replacement_parent.validated_atoms:
-                               if not atom.slot_operator == "=" or \
-                                       atom.blocker or \
+                               if atom.blocker or \
                                        atom.cp != dep.atom.cp:
                                        continue
 
index 96cc8f1bdc47ef6532a94e2e5cce4d4e08b2eb37..9fd9164f0b3c8683e3facb53902b2edd69dca7bf 100644 (file)
@@ -180,3 +180,58 @@ class SlotConflictRebuildTestCase(TestCase):
                                self.assertEqual(test_case.test_success, True, test_case.fail_msg)
                finally:
                        playground.cleanup()
+
+       def testSlotConflictDepChange(self):
+               """
+               Bug 490362
+               The dependency in the ebuild was changed form slot operator to
+               no slot operator. The vdb contained the slot operator and emerge
+               would refuse to rebuild.
+               """
+               ebuilds = {
+                       "app-misc/A-1" : {
+                               "EAPI": "5",
+                               "DEPEND": "app-misc/B",
+                               "RDEPEND": "app-misc/B"
+                       },
+
+                       "app-misc/B-1" : {
+                               "EAPI": "5",
+                               "SLOT": "0/1"
+                       },
+
+                       "app-misc/B-2" : {
+                               "EAPI": "5",
+                               "SLOT": "0/2"
+                       },
+               }
+
+               installed = {
+                       "app-misc/A-1" : {
+                               "EAPI": "5",
+                               "DEPEND": "app-misc/B:0/1=",
+                               "RDEPEND": "app-misc/B:0/1="
+                       },
+                       "app-misc/B-1" : {
+                               "EAPI": "5",
+                               "SLOT": "0/1"
+                       },
+               }
+
+               test_cases = (
+                       ResolverPlaygroundTestCase(
+                               ["app-misc/B"],
+                               success = True,
+                               mergelist = ['app-misc/B-2', 'app-misc/A-1']),
+               )
+
+               world = ["app-misc/A"]
+
+               playground = ResolverPlayground(ebuilds=ebuilds,
+                       installed=installed, world=world, debug=False)
+               try:
+                       for test_case in test_cases:
+                               playground.run_TestCase(test_case)
+                               self.assertEqual(test_case.test_success, True, test_case.fail_msg)
+               finally:
+                       playground.cleanup()