diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-05-29 12:10:09 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-05-29 12:10:09 +0000 |
commit | 7f8989f9099e1cfdc20bb3cae56e2923f2435014 (patch) | |
tree | 6430d90b0eee5ee032c4ec83f5b42ec0237008d2 /pym/portage | |
parent | 9709c10caf97845bd91b1f4eef7ece28ca88fb76 (diff) | |
download | portage-7f8989f9099e1cfdc20bb3cae56e2923f2435014.tar.gz portage-7f8989f9099e1cfdc20bb3cae56e2923f2435014.tar.bz2 portage-7f8989f9099e1cfdc20bb3cae56e2923f2435014.zip |
Don't pass slotted packages into pkgsplit since it doesn't handle them.
svn path=/main/trunk/; revision=6659
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/dep.py | 15 |
1 files 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 |