Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 522084
Collapse All | Expand All

(-)a/pym/_emerge/depgraph.py (-7 / +7 lines)
Lines 1171-1182 class depgraph(object): Link Here
1171
					for match in matched:
1171
					for match in matched:
1172
						writemsg_level("         match: %s\n" % match, level=logging.DEBUG, noiselevel=-1)
1172
						writemsg_level("         match: %s\n" % match, level=logging.DEBUG, noiselevel=-1)
1173
1173
1174
				if len(matched) == len(conflict):
1174
				if len(matched) > 1:
1175
					# All packages match.
1175
					# Even if all packages match, This parent must still
1176
					continue
1176
					# be added to the conflict_graph. Otherwise, we risk
1177
					# removing all of these packages from the depgraph,
1178
					# which could cause a missed update (bug #522084).
1179
					conflict_graph.add(or_tuple(matched), parent)
1177
				elif len(matched) == 1:
1180
				elif len(matched) == 1:
1178
					conflict_graph.add(matched[0], parent)
1181
					conflict_graph.add(matched[0], parent)
1179
				elif len(matched) == 0:
1182
				else:
1180
					# This typically means that autounmask broke a
1183
					# This typically means that autounmask broke a
1181
					# USE-dep, but it could also be due to the slot
1184
					# USE-dep, but it could also be due to the slot
1182
					# not matching due to multislot (bug #220341).
1185
					# not matching due to multislot (bug #220341).
Lines 1188-1196 class depgraph(object): Link Here
1188
						for pkg in conflict:
1191
						for pkg in conflict:
1189
							writemsg_level("         non-match: %s\n" % pkg,
1192
							writemsg_level("         non-match: %s\n" % pkg,
1190
								level=logging.DEBUG, noiselevel=-1)
1193
								level=logging.DEBUG, noiselevel=-1)
1191
				else:
1192
					# More than one packages matched, but not all.
1193
					conflict_graph.add(or_tuple(matched), parent)
1194
1194
1195
		for pkg in indirect_conflict_pkgs:
1195
		for pkg in indirect_conflict_pkgs:
1196
			for parent, atom in self._dynamic_config._parent_atoms.get(pkg, []):
1196
			for parent, atom in self._dynamic_config._parent_atoms.get(pkg, []):
(-)a/pym/portage/tests/resolver/test_solve_non_slot_operator_slot_conflicts.py (-1 / +74 lines)
Line 0 Link Here
0
- 
1
# Copyright 2014 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
4
from portage.tests import TestCase
5
from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
6
	ResolverPlaygroundTestCase)
7
8
class SolveNonSlotOperatorSlotConflictsTestCase(TestCase):
9
10
	def testSolveNonSlotOperatorSlotConflicts(self):
11
12
		ebuilds = {
13
14
			"app-misc/A-1" : {
15
				"EAPI": "5",
16
				"SLOT": "0/1",
17
				"PDEPEND": "app-misc/B"
18
			},
19
20
			"app-misc/A-2" : {
21
				"EAPI": "5",
22
				"SLOT": "0/2",
23
				"PDEPEND": "app-misc/B"
24
			},
25
26
			"app-misc/B-0" : {
27
				"EAPI": "5",
28
				"RDEPEND": "app-misc/A:="
29
			},
30
31
		}
32
33
		installed = {
34
35
			"app-misc/A-1" : {
36
				"EAPI": "5",
37
				"SLOT": "0/1",
38
				"PDEPEND": "app-misc/B"
39
			},
40
41
			"app-misc/B-0" : {
42
				"EAPI": "5",
43
				"RDEPEND": "app-misc/A:0/1="
44
			},
45
46
		}
47
48
		world = ["app-misc/A"]
49
50
		test_cases = (
51
52
			# bug 522084
53
			# In this case, _solve_non_slot_operator_slot_conflicts
54
			# removed both versions of app-misc/A from the graph, since
55
			# they didn't have any non-conflict parents (except for
56
			# @selected which matched both instances). The result was
57
			# a missed update.
58
			ResolverPlaygroundTestCase(
59
				["@world"],
60
				options = {"--update": True, "--deep": True},
61
				success = True,
62
				mergelist = ['app-misc/A-2', 'app-misc/B-0']
63
			),
64
65
		)
66
67
		playground = ResolverPlayground(ebuilds=ebuilds,
68
			installed=installed, world=world, debug=False)
69
		try:
70
			for test_case in test_cases:
71
				playground.run_TestCase(test_case)
72
				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
73
		finally:
74
			playground.cleanup()

Return to bug 522084