summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-30 22:00:49 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-30 22:00:49 +0000
commit8d1b3138238bcfe0c78e58efc47788e08cbb8a07 (patch)
tree04027cfb63880bd9204c1d078f5f99f2695f5d51 /pym
parentd04efcdcc909361603d26d95452574647683bd5e (diff)
downloadportage-8d1b3138238bcfe0c78e58efc47788e08cbb8a07.tar.gz
portage-8d1b3138238bcfe0c78e58efc47788e08cbb8a07.tar.bz2
portage-8d1b3138238bcfe0c78e58efc47788e08cbb8a07.zip
Implement license filtering for xmatch minimum-visible and
bestmatch-visible. Also, make the gvisible license filtering conditional on config.local_config since repoman doesn't do license filtering. svn path=/main/trunk/; revision=8343
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/porttree.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index aad388508..230c96cb6 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -597,14 +597,13 @@ class portdbapi(dbapi):
# Find the minimum matching visible version. This is optimized to
# minimize the number of metadata accesses (improves performance
# especially in cases where metadata needs to be generated).
- # This does not implement LICENSE filtering since it's only
- # intended for use by repoman.
if mydep == mykey:
mylist = self.cp_list(mykey)
else:
mylist = match_from_list(mydep, self.cp_list(mykey))
myval = ""
settings = self.mysettings
+ local_config = settings.local_config
if level == "minimum-visible":
iterfunc = iter
else:
@@ -626,6 +625,16 @@ class portdbapi(dbapi):
continue
if settings.getProfileMaskAtom(cpv, metadata):
continue
+ if local_config:
+ metadata["USE"] = ""
+ if "?" in metadata["LICENSE"]:
+ self.doebuild_settings.setcpv(cpv, mydb=metadata)
+ metadata["USE"] = self.doebuild_settings.get("USE", "")
+ try:
+ if settings.getMissingLicenses(cpv, metadata):
+ continue
+ except InvalidDependString:
+ continue
myval = cpv
break
elif level == "bestmatch-list":
@@ -702,6 +711,7 @@ class portdbapi(dbapi):
newlist=[]
aux_keys = ["IUSE", "KEYWORDS", "LICENSE", "EAPI", "SLOT"]
metadata = {}
+ local_config = self.mysettings.local_config
for mycpv in mylist:
metadata.clear()
try:
@@ -718,15 +728,16 @@ class portdbapi(dbapi):
continue
if self.mysettings.getMissingKeywords(mycpv, metadata):
continue
- metadata["USE"] = ""
- if "?" in metadata["LICENSE"]:
- self.doebuild_settings.setcpv(mycpv, mydb=metadata)
- metadata["USE"] = self.doebuild_settings.get("USE", "")
- try:
- if self.mysettings.getMissingLicenses(mycpv, metadata):
+ if local_config:
+ metadata["USE"] = ""
+ if "?" in metadata["LICENSE"]:
+ self.doebuild_settings.setcpv(mycpv, mydb=metadata)
+ metadata["USE"] = self.doebuild_settings.get("USE", "")
+ try:
+ if self.mysettings.getMissingLicenses(mycpv, metadata):
+ continue
+ except InvalidDependString:
continue
- except InvalidDependString:
- continue
newlist.append(mycpv)
return newlist