From 7f8989f9099e1cfdc20bb3cae56e2923f2435014 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 29 May 2007 12:10:09 +0000 Subject: [PATCH] Don't pass slotted packages into pkgsplit since it doesn't handle them. svn path=/main/trunk/; revision=6659 --- pym/portage/dep.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pym/portage/dep.py b/pym/portage/dep.py index 3f6b2a0ce..0bc90cc31 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -393,6 +393,12 @@ def dep_getslot(mydep): return mydep[colon+1:] return None +def remove_slot(mydep): + colon = mydep.rfind(":") + if colon != -1: + mydep = mydep[:colon] + return mydep + def dep_getusedeps( depend ): """ Pull a listing of USE Dependencies out of a dep atom. @@ -659,7 +665,8 @@ def match_from_list(mydep, candidate_list): mylist.append(x) elif operator == "=": # Exact match - mylist = [cpv for cpv in candidate_list if cpvequal(cpv, mycpv)] + mylist = [cpv for cpv in candidate_list if \ + cpvequal(remove_slot(cpv), mycpv)] elif operator == "=*": # glob match # XXX: Nasty special casing for leading zeros @@ -671,7 +678,7 @@ def match_from_list(mydep, candidate_list): myver = "0"+myver mycpv = mysplit[0]+"/"+mysplit[1]+"-"+myver for x in candidate_list: - xs = catpkgsplit(x) + xs = catpkgsplit(remove_slot(x)) myver = xs[2].lstrip("0") if not myver or not myver[0].isdigit(): myver = "0"+myver @@ -681,7 +688,7 @@ def match_from_list(mydep, candidate_list): elif operator == "~": # version, any revision, match for x in candidate_list: - xs = catpkgsplit(x) + xs = catpkgsplit(remove_slot(x)) if xs is None: raise InvalidData(x) if not cpvequal(xs[0]+"/"+xs[1]+"-"+xs[2], mycpv_cps[0]+"/"+mycpv_cps[1]+"-"+mycpv_cps[2]): @@ -694,7 +701,7 @@ def match_from_list(mydep, candidate_list): mysplit = ["%s/%s" % (cat, pkg), ver, rev] for x in candidate_list: try: - result = pkgcmp(pkgsplit(x), mysplit) + result = pkgcmp(pkgsplit(remove_slot(x)), mysplit) except ValueError: # pkgcmp may return ValueError during int() conversion writemsg("\nInvalid package name: %s\n" % x, noiselevel=-1) raise -- 2.26.2