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

(-)pym/portage.py (+49 lines)
Lines 3475-3480 Link Here
3475
				newsplit.append(x)
3475
				newsplit.append(x)
3476
	return newsplit
3476
	return newsplit
3477
3477
3478
def expand_new_virtuals(mysplit, mydbapi, mysettings, use, mode, myuse,
3479
	use_cache, use_binaries, myroot, trees, return_all_deps):
3480
	""" Recursively expand new-style virtuals so as to
3481
	collapse one or more levels of indirection."""
3482
	newsplit = []
3483
	dep_keys = ["RDEPEND","DEPEND","PDEPEND"]
3484
	def compare_pkgs(a, b):
3485
		return pkgcmp(b[1], a[1])
3486
	portdb = trees[myroot]["porttree"].dbapi
3487
	for x in mysplit:
3488
		if type(x) == types.ListType:
3489
			newsplit.append(expand_new_virtuals(x, mydbapi, mysettings, use,
3490
				mode, myuse, use_cache, use_binaries, myroot, trees,
3491
				return_all_deps))
3492
			continue
3493
		elif x.startswith("!"):
3494
			newsplit.append(x)
3495
			continue
3496
		elif not dep_getkey(x).startswith("virtual/"):
3497
			newsplit.append(x)
3498
			continue
3499
		pkgs = []
3500
		for cpv in portdb.match(x):
3501
			# only use new-style matches
3502
			if cpv.startswith("virtual/"):
3503
				pkgs.append((cpv, pkgsplit(cpv)))
3504
		if not pkgs:
3505
			newsplit.append(x)
3506
			continue
3507
		pkgs.sort(compare_pkgs) # Prefer higher versions.
3508
		a = ['||']
3509
		for y in pkgs:
3510
			depstring = " ".join(portdb.aux_get(y[0], dep_keys))
3511
			mycheck = dep_check(depstring, mydbapi, mysettings, use=use,
3512
				mode=mode, myuse=myuse, use_cache=use_cache,
3513
				use_binaries=use_binaries, myroot=myroot, trees=trees,
3514
				return_all_deps=return_all_deps)
3515
			if not mycheck[0]:
3516
				raise portage_exception.ParseError(mycheck[1])
3517
			a.append(mycheck[1])
3518
		newsplit.append(a)
3519
	return newsplit
3520
3478
def dep_eval(deplist):
3521
def dep_eval(deplist):
3479
	if not deplist:
3522
	if not deplist:
3480
		return 1
3523
		return 1
Lines 3688-3693 Link Here
3688
	elif mysplit==[]:
3731
	elif mysplit==[]:
3689
		#dependencies were reduced to nothing
3732
		#dependencies were reduced to nothing
3690
		return [1,[]]
3733
		return [1,[]]
3734
3735
	# Recursively expand new-style virtuals so as to
3736
	# collapse one or more levels of indirection.
3737
	mysplit = expand_new_virtuals(mysplit, mydbapi, mysettings, use, mode,
3738
		myuse, use_cache, use_binaries, myroot, trees, return_all_deps)
3739
3691
	mysplit2=mysplit[:]
3740
	mysplit2=mysplit[:]
3692
	mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache)
3741
	mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache)
3693
	if mysplit2 is None:
3742
	if mysplit2 is None:

Return to bug 141118