From c752202d57a1e3163aded69301e2d71d1ea26ae7 Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Tue, 26 Nov 2013 21:06:23 +0100 Subject: [PATCH] Fix a missing rebuild 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 | 3 +- .../resolver/test_slot_conflict_rebuild.py | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 033057b9a..da2e60422 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -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 diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py index 96cc8f1bd..9fd9164f0 100644 --- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py +++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py @@ -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() -- 2.26.2