From 168a5e7c2bd613242615e864d4e5f9dbcc409e32 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 4 Oct 2007 04:00:28 +0000 Subject: Add EAPI masking support for binary packages. svn path=/main/trunk/; revision=7913 --- pym/emerge/__init__.py | 22 ++++++++++++++++++---- pym/portage/dbapi/bintree.py | 2 +- 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): -- cgit v1.2.3-1-g7c22