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

(-)/home/gentoo/portage/test-branches/vanilla/pym/portage.py (-4 / +15 lines)
Lines 3752-3757 Link Here
3752
3698
3753
	return operator
3699
	return operator
3754
3700
3701
def cpvequal(cpv1, cpv2):
3702
	split1 = catpkgsplit(cpv1)
3703
	split2 = catpkgsplit(cpv2)
3704
	
3705
	if not split1 or not split2:
3706
		raise portage_exception.PortageException("Invalid data, parameter was not a CPV")
3707
	
3708
	if split1[0] != split2[0]:
3709
		return False
3710
	
3711
	return (pkgcmp(split1[1:], split2[1:]) == 0)
3712
3755
3713
3756
def match_from_list(mydep,candidate_list):
3714
def match_from_list(mydep,candidate_list):
3757
	if mydep[0] == "!":
3715
	if mydep[0] == "!":
Lines 3790-3808 Link Here
3790
			mylist.append(x)
3748
			mylist.append(x)
3791
3749
3792
	elif operator == "=": # Exact match
3750
	elif operator == "=": # Exact match
3793
		if mycpv in candidate_list:
3751
		mylist = [cpv for cpv in candidate_list if cpvequal(cpv, mycpv)]
3794
			mylist = [mycpv]
3795
3752
3796
	elif operator == "=*": # glob match
3753
	elif operator == "=*": # glob match
3797
		# The old verion ignored _tag suffixes... This one doesn't.
3754
		# The old verion ignored _tag suffixes... This one doesn't.
3798
		for x in candidate_list:
3755
		for x in candidate_list:
3799
			if x[0:len(mycpv)] == mycpv:
3756
			if cpvequal(x[0:len(mycpv)], mycpv):
3800
				mylist.append(x)
3757
				mylist.append(x)
3801
3758
3802
	elif operator == "~": # version, any revision, match
3759
	elif operator == "~": # version, any revision, match
3803
		for x in candidate_list:
3760
		for x in candidate_list:
3804
			xs = catpkgsplit(x)
3761
			xs = catpkgsplit(x)
3805
			if xs[0:2] != mycpv_cps[0:2]:
3762
			if not cpvequal(xs[0]+"/"+xs[1]+"-"+xs[2], mycpv_cps[0]+"/"+mycpv_cps[1]+"-"+mycpv_cps[2]):
3806
				continue
3763
				continue
3807
			if xs[2] != ver:
3764
			if xs[2] != ver:
3808
				continue
3765
				continue

Return to bug 70416