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

(-)a/pym/portage/dep/dep_check.py (+10 lines)
Lines 287-292 def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): Link Here
287
	unsat_use_non_installed = []
287
	unsat_use_non_installed = []
288
	other_installed = []
288
	other_installed = []
289
	other_installed_some = []
289
	other_installed_some = []
290
	other_installed_any_slot = []
290
	other = []
291
	other = []
291
292
292
	# unsat_use_* must come after preferred_non_installed
293
	# unsat_use_* must come after preferred_non_installed
Lines 301-306 def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): Link Here
301
		unsat_use_non_installed,
302
		unsat_use_non_installed,
302
		other_installed,
303
		other_installed,
303
		other_installed_some,
304
		other_installed_some,
305
		other_installed_any_slot,
304
		other,
306
		other,
305
	)
307
	)
306
308
Lines 504-509 def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None): Link Here
504
				other_installed.append(this_choice)
506
				other_installed.append(this_choice)
505
			elif some_installed:
507
			elif some_installed:
506
				other_installed_some.append(this_choice)
508
				other_installed_some.append(this_choice)
509
510
			# Use Atom(atom.cp) for a somewhat "fuzzy" match, since
511
			# the whole atom may be too specific. For example, see
512
			# bug #522652, where using the whole atom leads to an
513
			# unsatisfiable choice.
514
			elif any(vardb.match(Atom(atom.cp)) for atom in atoms
515
				if not atom.blocker):
516
				other_installed_any_slot.append(this_choice)
507
			else:
517
			else:
508
				other.append(this_choice)
518
				other.append(this_choice)
509
519
(-)a/pym/portage/tests/resolver/test_or_choices.py (-1 / +73 lines)
Lines 132-134 class OrChoicesTestCase(TestCase): Link Here
132
				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
132
				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
133
		finally:
133
		finally:
134
			playground.cleanup()
134
			playground.cleanup()
135
- 
135
136
137
	def testInitiallyUnsatisfied(self):
138
139
		ebuilds = {
140
141
			"app-misc/A-1" : {
142
				"EAPI": "5",
143
				"SLOT": "0/1"
144
			},
145
146
			"app-misc/A-2" : {
147
				"EAPI": "5",
148
				"SLOT": "0/2"
149
			},
150
151
			"app-misc/B-0" : {
152
				"EAPI": "5",
153
				"RDEPEND": "app-misc/A:="
154
			},
155
156
			"app-misc/C-0" : {
157
				"EAPI": "5",
158
				"RDEPEND": "|| ( app-misc/X <app-misc/A-2 )"
159
			},
160
161
		}
162
163
		installed = {
164
165
			"app-misc/A-1" : {
166
				"EAPI": "5",
167
				"SLOT": "0/1"
168
			},
169
170
			"app-misc/B-0" : {
171
				"EAPI": "5",
172
				"RDEPEND": "app-misc/A:0/1="
173
			},
174
175
			"app-misc/C-0" : {
176
				"EAPI": "5",
177
				"RDEPEND": "|| ( app-misc/X <app-misc/A-2 )"
178
			},
179
180
		}
181
182
		world = ["app-misc/B", "app-misc/C"]
183
184
		test_cases = (
185
186
			# Test bug #522652, where the unsatisfiable app-misc/X
187
			# atom is selected, and the dependency is placed into
188
			# _initially_unsatisfied_deps where it is ignored, causing
189
			# upgrade to app-misc/A-2 (breaking a dependency of
190
			# app-misc/C-0).
191
			ResolverPlaygroundTestCase(
192
				["app-misc/A"],
193
				options = {},
194
				success = True,
195
				mergelist = ['app-misc/A-1']
196
			),
197
198
		)
199
200
		playground = ResolverPlayground(ebuilds=ebuilds,
201
			installed=installed, world=world, debug=False)
202
		try:
203
			for test_case in test_cases:
204
				playground.run_TestCase(test_case)
205
				self.assertEqual(test_case.test_success, True, test_case.fail_msg)
206
		finally:
207
			playground.cleanup()

Return to bug 522652