Add EAPI masking support for binary packages.
authorZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 04:00:28 +0000 (04:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 4 Oct 2007 04:00:28 +0000 (04:00 -0000)
svn path=/main/trunk/; revision=7913

pym/emerge/__init__.py
pym/portage/dbapi/bintree.py

index 7c00cdf748552689db3c2387234607ed7462187a..efe456d3f108374226eee3978d46f5c91c12d081 100644 (file)
@@ -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."
index e8e114fa4173a88d5efafd689766745b280def30..5ee45f975b7809ac1efd8554e27f75d52aa3b1eb 100644 (file)
@@ -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):