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

(-)a/pym/_emerge/resolver/slot_collision.py (-16 / +29 lines)
Lines 231-244 class slot_conflict_handler(object): Link Here
231
								collision_reasons[("version", sub_type)] = atoms
231
								collision_reasons[("version", sub_type)] = atoms
232
							elif not atom_set.findAtomForPackage(other_pkg, \
232
							elif not atom_set.findAtomForPackage(other_pkg, \
233
								modified_use=_pkg_use_enabled(other_pkg)):
233
								modified_use=_pkg_use_enabled(other_pkg)):
234
								#Use conditionals not met.
234
								missing_iuse = other_pkg.iuse.get_missing_iuse(
235
								violated_atom = atom.violated_conditionals(_pkg_use_enabled(other_pkg), \
235
									atom.unevaluated_atom.use.required)
236
									other_pkg.iuse.is_valid_flag)
236
								if missing_iuse:
237
								for flag in violated_atom.use.enabled.union(violated_atom.use.disabled):
237
									for flag in missing_iuse:
238
									atoms = collision_reasons.get(("use", flag), set())
238
										atoms = collision_reasons.get(("use", flag), set())
239
									atoms.add((ppkg, atom, other_pkg))
239
										atoms.add((ppkg, atom, other_pkg))
240
									collision_reasons[("use", flag)] = atoms
240
										collision_reasons[("use", flag)] = atoms
241
								num_all_specific_atoms += 1
241
									num_all_specific_atoms += 1
242
								else:
243
									#Use conditionals not met.
244
									violated_atom = atom.violated_conditionals(_pkg_use_enabled(other_pkg), \
245
										other_pkg.iuse.is_valid_flag)
246
									for flag in violated_atom.use.enabled.union(violated_atom.use.disabled):
247
										atoms = collision_reasons.get(("use", flag), set())
248
										atoms.add((ppkg, atom, other_pkg))
249
										collision_reasons[("use", flag)] = atoms
250
									num_all_specific_atoms += 1
242
251
243
					msg.append(" pulled in by\n")
252
					msg.append(" pulled in by\n")
244
253
Lines 296-315 class slot_conflict_handler(object): Link Here
296
						atom_str = str(atom)
305
						atom_str = str(atom)
297
						if version:
306
						if version:
298
							op = atom.operator
307
							op = atom.operator
299
							ver = cpv_getversion(atom.cpv)
308
							ver = None
309
							if atom.cp != atom.cpv:
310
								ver = cpv_getversion(atom.cpv)
300
							slot = atom.slot
311
							slot = atom.slot
301
312
302
							if op == "=*":
313
							if op == "=*":
303
								op = "="
314
								op = "="
304
								ver += "*"
315
								ver += "*"
305
316
306
							atom_str = atom_str.replace(op, colorize("BAD", op), 1)
317
							if op is not None:
307
							
318
								atom_str = atom_str.replace(op, colorize("BAD", op), 1)
308
							start = atom_str.rfind(ver)
319
309
							end = start + len(ver)
320
							if ver is not None:
310
							atom_str = atom_str[:start] + \
321
								start = atom_str.rfind(ver)
311
								colorize("BAD", ver) + \
322
								end = start + len(ver)
312
								atom_str[end:]
323
								atom_str = atom_str[:start] + \
324
									colorize("BAD", ver) + \
325
									atom_str[end:]
313
							if slot:
326
							if slot:
314
								atom_str = atom_str.replace(":" + slot, colorize("BAD", ":" + slot))
327
								atom_str = atom_str.replace(":" + slot, colorize("BAD", ":" + slot))
315
						
328
						
(-)a/pym/portage/dep/__init__.py (-1 / +8 lines)
Lines 1134-1140 class Atom(_atom_base): Link Here
1134
			without_use = Atom(m.group('without_use'), allow_repo=allow_repo)
1134
			without_use = Atom(m.group('without_use'), allow_repo=allow_repo)
1135
		else:
1135
		else:
1136
			use = None
1136
			use = None
1137
			without_use = self
1137
			if unevaluated_atom is not None and \
1138
				unevaluated_atom.use is not None:
1139
				# unevaluated_atom.use is used for IUSE checks when matching
1140
				# packages, so it must not propagate to without_use
1141
				without_use = Atom(s, allow_wildcard=allow_wildcard,
1142
					allow_repo=allow_repo)
1143
			else:
1144
				without_use = self
1138
1145
1139
		self.__dict__['use'] = use
1146
		self.__dict__['use'] = use
1140
		self.__dict__['without_use'] = without_use
1147
		self.__dict__['without_use'] = without_use
(-)a/pym/portage/tests/resolver/test_slot_collisions.py (+12 lines)
Lines 15-20 class SlotCollisionTestCase(TestCase): Link Here
15
			"dev-libs/B-1": { "IUSE": "foo" },
15
			"dev-libs/B-1": { "IUSE": "foo" },
16
			"dev-libs/C-1": { "DEPEND": "dev-libs/A[foo]", "EAPI": 2 },
16
			"dev-libs/C-1": { "DEPEND": "dev-libs/A[foo]", "EAPI": 2 },
17
			"dev-libs/D-1": { "DEPEND": "dev-libs/A[foo=] dev-libs/B[foo=]", "IUSE": "foo", "EAPI": 2 },
17
			"dev-libs/D-1": { "DEPEND": "dev-libs/A[foo=] dev-libs/B[foo=]", "IUSE": "foo", "EAPI": 2 },
18
			"dev-libs/E-1": {  },
19
			"dev-libs/E-2": { "IUSE": "foo" },
18
20
19
			"app-misc/Z-1": { },
21
			"app-misc/Z-1": { },
20
			"app-misc/Z-2": { },
22
			"app-misc/Z-2": { },
Lines 30-35 class SlotCollisionTestCase(TestCase): Link Here
30
			"app-misc/A-1": { "IUSE": "foo +bar", "REQUIRED_USE": "^^ ( foo bar )", "EAPI": EAPI_4 },
32
			"app-misc/A-1": { "IUSE": "foo +bar", "REQUIRED_USE": "^^ ( foo bar )", "EAPI": EAPI_4 },
31
			"app-misc/B-1": { "DEPEND": "=app-misc/A-1[foo=]", "IUSE": "foo", "EAPI": 2 },
33
			"app-misc/B-1": { "DEPEND": "=app-misc/A-1[foo=]", "IUSE": "foo", "EAPI": 2 },
32
			"app-misc/C-1": { "DEPEND": "=app-misc/A-1[foo]", "EAPI": 2 },
34
			"app-misc/C-1": { "DEPEND": "=app-misc/A-1[foo]", "EAPI": 2 },
35
			"app-misc/E-1": { "RDEPEND": "dev-libs/E[foo?]", "IUSE": "foo", "EAPI": "2" },
36
			"app-misc/F-1": { "RDEPEND": "=dev-libs/E-1", "IUSE": "foo", "EAPI": "2" },
33
			}
37
			}
34
		installed = {
38
		installed = {
35
			"dev-libs/A-1": { "PDEPEND": "foo? ( dev-libs/B )", "IUSE": "foo", "USE": "foo" }, 
39
			"dev-libs/A-1": { "PDEPEND": "foo? ( dev-libs/B )", "IUSE": "foo", "USE": "foo" }, 
Lines 68-73 class SlotCollisionTestCase(TestCase): Link Here
68
				slot_collision_solutions = []
72
				slot_collision_solutions = []
69
				),
73
				),
70
74
75
			ResolverPlaygroundTestCase(
76
				["=app-misc/E-1", "=app-misc/F-1"],
77
				success = False,
78
				mergelist = ["dev-libs/E-1", "dev-libs/E-2", "app-misc/E-1", "app-misc/F-1"],
79
				ignore_mergelist_order = True,
80
				slot_collision_solutions = []
81
				),
82
71
			#Simple cases.
83
			#Simple cases.
72
			ResolverPlaygroundTestCase(
84
			ResolverPlaygroundTestCase(
73
				["sci-libs/L", "sci-libs/M"],
85
				["sci-libs/L", "sci-libs/M"],

Return to bug 348389