Gentoo Archives: gentoo-portage-dev

From: SebastianLuther@×××.de
To: gentoo-portage-dev@l.g.o
Cc: Sebastian Luther <SebastianLuther@×××.de>
Subject: [gentoo-portage-dev] [PATCH 1/2] Fix a missing rebuild (bug 490362)
Date: Tue, 26 Nov 2013 20:08:20
Message-Id: 1385496384-30610-2-git-send-email-SebastianLuther@gmx.de
In Reply to: [gentoo-portage-dev] Another slot operator fix by SebastianLuther@gmx.de
1 From: Sebastian Luther <SebastianLuther@×××.de>
2
3 The dependency in the ebuild was changed from
4 slot operator to no slot operator. The vdb
5 contained the slot operator and emerge would
6 refuse to rebuild, causing a missed update.
7 ---
8 pym/_emerge/depgraph.py | 3 +-
9 .../tests/resolver/test_slot_conflict_rebuild.py | 55 ++++++++++++++++++++++
10 2 files changed, 56 insertions(+), 2 deletions(-)
11
12 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
13 index 033057b..da2e604 100644
14 --- a/pym/_emerge/depgraph.py
15 +++ b/pym/_emerge/depgraph.py
16 @@ -1301,8 +1301,7 @@ class depgraph(object):
17 selected_atoms = None
18
19 for atom in replacement_parent.validated_atoms:
20 - if not atom.slot_operator == "=" or \
21 - atom.blocker or \
22 + if atom.blocker or \
23 atom.cp != dep.atom.cp:
24 continue
25
26 diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
27 index 0fe8f5d..f39508c 100644
28 --- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
29 +++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py
30 @@ -180,3 +180,58 @@ class SlotConflictRebuildTestCase(TestCase):
31 self.assertEqual(test_case.test_success, True, test_case.fail_msg)
32 finally:
33 playground.cleanup()
34 +
35 + def testSlotConflictDepChange(self):
36 + """
37 + Bug 490362
38 + The dependency in the ebuild was changed form slot operator to
39 + no slot operator. The vdb contained the slot operator and emerge
40 + would refuse to rebuild.
41 + """
42 + ebuilds = {
43 + "app-misc/A-1" : {
44 + "EAPI": "5",
45 + "DEPEND": "app-misc/B",
46 + "RDEPEND": "app-misc/B"
47 + },
48 +
49 + "app-misc/B-1" : {
50 + "EAPI": "5",
51 + "SLOT": "0/1"
52 + },
53 +
54 + "app-misc/B-2" : {
55 + "EAPI": "5",
56 + "SLOT": "0/2"
57 + },
58 + }
59 +
60 + installed = {
61 + "app-misc/A-1" : {
62 + "EAPI": "5",
63 + "DEPEND": "app-misc/B:0/1=",
64 + "RDEPEND": "app-misc/B:0/1="
65 + },
66 + "app-misc/B-1" : {
67 + "EAPI": "5",
68 + "SLOT": "0/1"
69 + },
70 + }
71 +
72 + test_cases = (
73 + ResolverPlaygroundTestCase(
74 + ["app-misc/B"],
75 + success = True,
76 + mergelist = ['app-misc/B-2', 'app-misc/A-1']),
77 + )
78 +
79 + world = ["app-misc/A"]
80 +
81 + playground = ResolverPlayground(ebuilds=ebuilds,
82 + installed=installed, world=world, debug=False)
83 + try:
84 + for test_case in test_cases:
85 + playground.run_TestCase(test_case)
86 + self.assertEqual(test_case.test_success, True, test_case.fail_msg)
87 + finally:
88 + playground.cleanup()
89 --
90 1.8.1.5