Add EAPI masking support for binary packages. (trunk r7913)
authorZac Medico <zmedico@gentoo.org>
Fri, 5 Oct 2007 03:05:50 +0000 (03:05 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 5 Oct 2007 03:05:50 +0000 (03:05 -0000)
svn path=/main/branches/2.1.2/; revision=7935

bin/emerge
pym/portage.py

index 4909a5f2502168603a79aeb3c7c6fabd3dfd1d63..af1042c8fa31220f674b4929cd00d8c66089d103 100755 (executable)
@@ -43,6 +43,7 @@ bad = create_color_func("BAD")
 # white looks bad on terminals with white background
 from output import bold as white
 
+import portage_const
 import portage_dep
 portage_dep._dep_check_strict = True
 import portage_util
@@ -1846,8 +1847,13 @@ class depgraph:
                                        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).
@@ -1974,11 +1980,20 @@ class depgraph:
                                                        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 dca191dcd98da268b8a3dd8107789fa826f1d76a..693333b7b22bc772255b403ad278da7b3018d439 100644 (file)
@@ -5304,7 +5304,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):