summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-04 04:00:28 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-04 04:00:28 +0000
commit168a5e7c2bd613242615e864d4e5f9dbcc409e32 (patch)
tree0baf3b8a6f23a96f22d4a7c912e7778d5604c721
parent40d1d5b23e5c05923f49030e9e1671c506e6bc6b (diff)
downloadportage-168a5e7c2bd613242615e864d4e5f9dbcc409e32.tar.gz
portage-168a5e7c2bd613242615e864d4e5f9dbcc409e32.tar.bz2
portage-168a5e7c2bd613242615e864d4e5f9dbcc409e32.zip
Add EAPI masking support for binary packages.
svn path=/main/trunk/; revision=7913
-rw-r--r--pym/emerge/__init__.py22
-rw-r--r--pym/portage/dbapi/bintree.py2
2 files changed, 19 insertions, 5 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index 7c00cdf74..efe456d3f 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -1768,8 +1768,13 @@ class depgraph(object):
usepkgonly = "--usepkgonly" in self.myopts
chost = pkgsettings["CHOST"]
myeb_pkg_matches = []
+ bindb_keys = ["CHOST","EAPI"]
for pkg in bindb.match(x):
- if chost != bindb.aux_get(pkg, ["CHOST"])[0]:
+ metadata = dict(izip(bindb_keys,
+ bindb.aux_get(pkg, bindb_keys)))
+ if chost != metadata["CHOST"]:
+ continue
+ if not portage.eapi_is_supported(metadata["EAPI"]):
continue
# Remove any binary package entries that are
# masked in the portage tree (#55871).
@@ -1927,11 +1932,20 @@ class depgraph(object):
alleb = bindb.match(x)
if alleb:
chost = pkgsettings["CHOST"]
+ bindb_keys = ["CHOST","EAPI"]
for p in alleb:
mreasons = []
- pkg_chost = bindb.aux_get(p, ["CHOST"])[0]
- if chost != pkg_chost:
- mreasons.append("CHOST: %s" % pkg_chost)
+ metadata = dict(izip(bindb_keys,
+ bindb.aux_get(pkg, bindb_keys)))
+ if chost != metadata["CHOST"]:
+ mreasons.append("CHOST: %s" % \
+ metadata["CHOST"])
+ if not portage.eapi_is_supported(
+ metadata["EAPI"]):
+ mreasons.append(("required EAPI %s" + \
+ ", supported EAPI %s") % \
+ (metadata["EAPI"],
+ portage.const.EAPI))
print "- "+p+" (masked by: "+", ".join(mreasons)+")"
print "!!! "+red("There are no packages available to satisfy: ")+green(xinfo)
print "!!! Either add a suitable binary package or compile from an ebuild."
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index e8e114fa4..5ee45f975 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -27,7 +27,7 @@ class bindbapi(fakedbapi):
self.settings = settings
self._match_cache = {}
# Selectively cache metadata in order to optimize dep matching.
- self._aux_cache_keys = set(["CHOST","SLOT"])
+ self._aux_cache_keys = set(["CHOST","EAPI","SLOT"])
self._aux_cache = {}
def match(self, *pargs, **kwargs):