summaryrefslogtreecommitdiffstats
path: root/pym/portage_dep.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-29 11:29:13 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-29 11:29:13 +0000
commitf681dbd0629a46702b57938bf6f8cda7e39e1fd4 (patch)
treeddeac1bc3246bb88ce140d0b255623c835b54629 /pym/portage_dep.py
parent7d9ec2790d9c89a3e111fc94b7fb4a4917f74c96 (diff)
downloadportage-f681dbd0629a46702b57938bf6f8cda7e39e1fd4.tar.gz
portage-f681dbd0629a46702b57938bf6f8cda7e39e1fd4.tar.bz2
portage-f681dbd0629a46702b57938bf6f8cda7e39e1fd4.zip
For bug #179870, add support for cpv:slot in match_from_list() and use it to make config.setcpv() distinguish slot atoms in package.use. (trunk r6657)
svn path=/main/branches/2.1.2/; revision=6658
Diffstat (limited to 'pym/portage_dep.py')
-rw-r--r--pym/portage_dep.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/pym/portage_dep.py b/pym/portage_dep.py
index 0b89d9b3e..7d9f5e0ea 100644
--- a/pym/portage_dep.py
+++ b/pym/portage_dep.py
@@ -568,19 +568,7 @@ def match_from_list(mydep, candidate_list):
if operator is None:
for x in candidate_list:
- xs = pkgsplit(x)
- if xs is None:
- xcpv = dep_getcpv(x)
- if slot is not None:
- xslot = dep_getslot(x)
- if xslot is not None and xslot != slot:
- """ This function isn't given enough information to
- reject atoms based on slot unless *both* compared atoms
- specify slots."""
- continue
- if xcpv != mycpv:
- continue
- elif xs[0] != mycpv:
+ if dep_getkey(x) != mycpv:
continue
mylist.append(x)
@@ -643,5 +631,14 @@ def match_from_list(mydep, candidate_list):
else:
raise KeyError("Unknown operator: %s" % mydep)
+ if slot is not None:
+ candidate_list = mylist
+ mylist = []
+ for x in candidate_list:
+ xslot = dep_getslot(x)
+ if xslot is not None and xslot != slot:
+ continue
+ mylist.append(x)
+
_match_from_list_cache[cache_key] = mylist
return mylist