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

(-)a/pym/_emerge/depgraph.py (+14 lines)
Lines 1059-1064 class depgraph(object): Link Here
1059
			def __str__(self):
1059
			def __str__(self):
1060
				return "(%s)" % ",".join(str(pkg) for pkg in self)
1060
				return "(%s)" % ",".join(str(pkg) for pkg in self)
1061
1061
1062
		non_matching_forced = set()
1062
		for conflict in conflicts:
1063
		for conflict in conflicts:
1063
			if debug:
1064
			if debug:
1064
				writemsg_level("   conflict:\n", level=logging.DEBUG, noiselevel=-1)
1065
				writemsg_level("   conflict:\n", level=logging.DEBUG, noiselevel=-1)
Lines 1105-1110 class depgraph(object): Link Here
1105
					continue
1106
					continue
1106
				elif len(matched) == 1:
1107
				elif len(matched) == 1:
1107
					conflict_graph.add(matched[0], parent)
1108
					conflict_graph.add(matched[0], parent)
1109
				elif len(matched) == 0:
1110
					# The typically means that autounmask broke a
1111
					# USE-dep, but it could also be due to the slot
1112
					# not matching due to multislot (bug #220341).
1113
					# Either way, don't try to solve this conflict.
1114
					# Instead, force them all into the graph so that
1115
					# they are protected from removal.
1116
					non_matching_forced.update(conflict)
1117
					if debug:
1118
						for pkg in conflict:
1119
							writemsg_level("         non-match: %s\n" % pkg,
1120
								level=logging.DEBUG, noiselevel=-1)
1108
				else:
1121
				else:
1109
					# More than one packages matched, but not all.
1122
					# More than one packages matched, but not all.
1110
					conflict_graph.add(or_tuple(matched), parent)
1123
					conflict_graph.add(or_tuple(matched), parent)
Lines 1125-1130 class depgraph(object): Link Here
1125
		# Now select required packages. Collect them in the
1138
		# Now select required packages. Collect them in the
1126
		# 'forced' set.
1139
		# 'forced' set.
1127
		forced = set([non_conflict_node])
1140
		forced = set([non_conflict_node])
1141
		forced.update(non_matching_forced)
1128
		unexplored = set([non_conflict_node])
1142
		unexplored = set([non_conflict_node])
1129
		# or_tuples get special handling. We first explore
1143
		# or_tuples get special handling. We first explore
1130
		# all packages in the hope of having forced one of
1144
		# all packages in the hope of having forced one of
(-)a/pym/portage/tests/resolver/ResolverPlayground.py (+9 lines)
Lines 549-554 class ResolverPlaygroundTestCase(object): Link Here
549
		self.all_permutations = kwargs.pop("all_permutations", False)
549
		self.all_permutations = kwargs.pop("all_permutations", False)
550
		self.ignore_mergelist_order = kwargs.pop("ignore_mergelist_order", False)
550
		self.ignore_mergelist_order = kwargs.pop("ignore_mergelist_order", False)
551
		self.ambiguous_merge_order = kwargs.pop("ambiguous_merge_order", False)
551
		self.ambiguous_merge_order = kwargs.pop("ambiguous_merge_order", False)
552
		self.ambiguous_slot_collision_solutions = kwargs.pop("ambiguous_slot_collision_solutions", False)
552
		self.check_repo_names = kwargs.pop("check_repo_names", False)
553
		self.check_repo_names = kwargs.pop("check_repo_names", False)
553
		self.merge_order_assertions = kwargs.pop("merge_order_assertions", False)
554
		self.merge_order_assertions = kwargs.pop("merge_order_assertions", False)
554
555
Lines 664-669 class ResolverPlaygroundTestCase(object): Link Here
664
									str((node1, node2))) + \
665
									str((node1, node2))) + \
665
									", got: " + str(got))
666
									", got: " + str(got))
666
667
668
			elif key == "slot_collision_solutions" and \
669
				self.ambiguous_slot_collision_solutions:
670
				# Tests that use all_permutations can have multiple
671
				# outcomes here.
672
				for x in expected:
673
					if x == got:
674
						expected = x
675
						break
667
			elif key in ("unstable_keywords", "needed_p_mask_changes",
676
			elif key in ("unstable_keywords", "needed_p_mask_changes",
668
				"unsatisfied_deps") and expected is not None:
677
				"unsatisfied_deps") and expected is not None:
669
				expected = set(expected)
678
				expected = set(expected)
(-)a/pym/portage/tests/resolver/test_autounmask_use_breakage.py (-1 / +63 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 AutounmaskUseBreakageTestCase(TestCase):
9
10
	def testAutounmaskUseBreakage(self):
11
12
		ebuilds = {
13
14
			"app-misc/A-0" : {
15
				"EAPI": "5",
16
				"RDEPEND": "app-misc/D[-foo]",
17
			},
18
19
			"app-misc/B-0" : {
20
				"EAPI": "5",
21
				"RDEPEND": "app-misc/D[foo]"
22
			},
23
24
			"app-misc/C-0" : {
25
				"EAPI": "5",
26
				"RDEPEND": ">=app-misc/D-1"
27
			},
28
29
			"app-misc/D-0" : {
30
				"EAPI": "5",
31
				"IUSE": "foo"
32
			},
33
34
			"app-misc/D-1" : {
35
				"EAPI": "5",
36
				"IUSE": "bar"
37
			},
38
39
		}
40
41
		test_cases = (
42
43
			# Bug 510270
44
			# _solve_non_slot_operator_slot_conflicts throws
45
			# IndexError: tuple index out of range
46
			# due to autounmask USE breakage.
47
			ResolverPlaygroundTestCase(
48
				["app-misc/C", "app-misc/B", "app-misc/A"],
49
				all_permutations = True,
50
				success = False,
51
				ambiguous_slot_collision_solutions = True,
52
				slot_collision_solutions = [None, []]
53
			),
54
55
		)
56
57
		playground = ResolverPlayground(ebuilds=ebuilds, debug=False)
58
		try:
59
			for test_case in test_cases:
60
				playground.run_TestCase(test_case)
61
				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
62
		finally:
63
			playground.cleanup()

Return to bug 510270