1 |
From: Sebastian Luther <SebastianLuther@×××.de> |
2 |
|
3 |
Fixes bug 497238. |
4 |
--- |
5 |
pym/_emerge/depgraph.py | 2 +- |
6 |
.../tests/resolver/test_slot_conflict_rebuild.py | 42 ++++++++++++++++++++++ |
7 |
2 files changed, 43 insertions(+), 1 deletion(-) |
8 |
|
9 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
10 |
index 763f3fd..2f01a56 100644 |
11 |
--- a/pym/_emerge/depgraph.py |
12 |
+++ b/pym/_emerge/depgraph.py |
13 |
@@ -1376,7 +1376,7 @@ class depgraph(object): |
14 |
selective and \ |
15 |
dep.parent.installed and \ |
16 |
dep.child.installed and \ |
17 |
- dep.parent.cpv == replacement_parent.cpv and \ |
18 |
+ dep.parent >= replacement_parent and \ |
19 |
dep.child.cpv == pkg.cpv: |
20 |
# Then can happen if the child's sub-slot changed |
21 |
# without a revision bump. The sub-slot change is |
22 |
diff --git a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py |
23 |
index 5acdadb..714ef8e 100644 |
24 |
--- a/pym/portage/tests/resolver/test_slot_conflict_rebuild.py |
25 |
+++ b/pym/portage/tests/resolver/test_slot_conflict_rebuild.py |
26 |
@@ -364,3 +364,45 @@ class SlotConflictRebuildTestCase(TestCase): |
27 |
self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
28 |
finally: |
29 |
playground.cleanup() |
30 |
+ |
31 |
+ |
32 |
+ def testSlotConflictMultiRepo(self): |
33 |
+ """ |
34 |
+ Bug 497238 |
35 |
+ Different repositories contain the same cpv with different sub-slots for |
36 |
+ a slot operator child. |
37 |
+ Downgrading the slot operator parent would result in a sub-slot change of |
38 |
+ the installed package by changing the source repository. |
39 |
+ Make sure we don't perform this undesirable rebuild. |
40 |
+ """ |
41 |
+ ebuilds = { |
42 |
+ "net-firewall/iptables-1.4.21::overlay" : { "EAPI": "5", "SLOT": "0/10" }, |
43 |
+ "sys-apps/iproute2-3.11.0::overlay" : { "EAPI": "5", "RDEPEND": "net-firewall/iptables:=" }, |
44 |
+ |
45 |
+ "net-firewall/iptables-1.4.21" : { "EAPI": "5", "SLOT": "0" }, |
46 |
+ "sys-apps/iproute2-3.12.0": { "EAPI": "5", "RDEPEND": "net-firewall/iptables:=" }, |
47 |
+ } |
48 |
+ |
49 |
+ installed = { |
50 |
+ "net-firewall/iptables-1.4.21::overlay" : { "EAPI": "5", "SLOT": "0/10" }, |
51 |
+ "sys-apps/iproute2-3.12.0": { "EAPI": "5", "RDEPEND": "net-firewall/iptables:0/10=" }, |
52 |
+ } |
53 |
+ |
54 |
+ world = ["sys-apps/iproute2"] |
55 |
+ |
56 |
+ test_cases = ( |
57 |
+ ResolverPlaygroundTestCase( |
58 |
+ ["@world"], |
59 |
+ options = {"--deep": True, "--update": True, "--verbose": True}, |
60 |
+ success = True, |
61 |
+ mergelist = []), |
62 |
+ ) |
63 |
+ |
64 |
+ playground = ResolverPlayground(ebuilds=ebuilds, |
65 |
+ installed=installed, world=world, debug=False) |
66 |
+ try: |
67 |
+ for test_case in test_cases: |
68 |
+ playground.run_TestCase(test_case) |
69 |
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
70 |
+ finally: |
71 |
+ playground.cleanup() |
72 |
-- |
73 |
1.8.3.2 |