summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-09-22 18:47:04 -0700
committerZac Medico <zmedico@gentoo.org>2011-09-22 18:47:04 -0700
commit1b4ee4f4c5c01c49b91f1618f4b2ab6305f28eca (patch)
tree6e8427081c00f8d22b06ac0e574316dd1208e386
parentportdbapi: handle multi-repo visiblity (diff)
downloadportage-1b4ee4f4c5c01c49b91f1618f4b2ab6305f28eca.tar.gz
portage-1b4ee4f4c5c01c49b91f1618f4b2ab6305f28eca.tar.bz2
portage-1b4ee4f4c5c01c49b91f1618f4b2ab6305f28eca.zip
Fix minimum/bestmatch-visible for multi-repo.
-rw-r--r--pym/portage/dbapi/porttree.py83
1 files changed, 52 insertions, 31 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 7f1bbf08f..4f5dc78d4 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -898,41 +898,62 @@ class portdbapi(dbapi):
iterfunc = iter
else:
iterfunc = reversed
+
+ if mydep.repo is not None or len(self.porttrees) == 1:
+ repos = [mydep.repo]
+ else:
+ # We iterate over self.porttrees, since it's common to
+ # tweak this attribute in order to adjust match behavior.
+ repos = []
+ for tree in reversed(self.porttrees):
+ repos.append(self.repositories.get_name_for_location(tree))
+
for cpv in iterfunc(mylist):
- try:
- metadata = dict(zip(aux_keys,
- self.aux_get(cpv, aux_keys)))
- except KeyError:
- # ebuild masked by corruption
- continue
- if not eapi_is_supported(metadata["EAPI"]):
- continue
- if mydep.slot and mydep.slot != metadata["SLOT"]:
- continue
- if settings._getMissingKeywords(cpv, metadata):
- continue
- if settings._getMaskAtom(cpv, metadata):
- continue
- if local_config:
- metadata["USE"] = ""
- if "?" in metadata["LICENSE"] or "?" in metadata["PROPERTIES"]:
- self.doebuild_settings.setcpv(cpv, mydb=metadata)
- metadata["USE"] = self.doebuild_settings.get("USE", "")
+ for repo in repos:
try:
- if settings._getMissingLicenses(cpv, metadata):
- continue
- if settings._getMissingProperties(cpv, metadata):
- continue
- except InvalidDependString:
+ metadata = dict(zip(aux_keys,
+ self.aux_get(cpv, aux_keys, myrepo=repo)))
+ except KeyError:
+ # ebuild not in this repo, or masked by corruption
continue
- if mydep.use:
- has_iuse = False
- for has_iuse in self._iter_match_use(mydep, [cpv]):
- break
- if not has_iuse:
+ if not eapi_is_supported(metadata["EAPI"]):
continue
- myval = cpv
- break
+ if mydep.slot is not None and \
+ mydep.slot != metadata["SLOT"]:
+ continue
+ if settings._getMissingKeywords(cpv, metadata):
+ continue
+ if settings._getMaskAtom(cpv, metadata):
+ continue
+ if local_config:
+ metadata["USE"] = ""
+ if "?" in metadata["LICENSE"] or \
+ "?" in metadata["PROPERTIES"]:
+ self.doebuild_settings.setcpv(cpv, mydb=metadata)
+ metadata["USE"] = \
+ self.doebuild_settings.get("PORTAGE_USE", "")
+ try:
+ if settings._getMissingLicenses(cpv, metadata):
+ continue
+ if settings._getMissingProperties(cpv, metadata):
+ continue
+ except InvalidDependString:
+ continue
+ if mydep.use is not None:
+ mydep_with_repo = mydep
+ if repo is not None and mydep.repo is None:
+ mydep_with_repo = mydep.with_repo(repo)
+ has_iuse = False
+ for has_iuse in self._iter_match_use(
+ mydep_with_repo, [cpv]):
+ break
+ if has_iuse is False:
+ continue
+ myval = cpv
+ break
+ if myval:
+ break
+
elif level == "bestmatch-list":
#dep match -- find best match but restrict search to sublist
#no point in calling xmatch again since we're not caching list deps