Bug #201848 - Mask ebuilds that do not define SLOT. (trunk r8894)
authorZac Medico <zmedico@gentoo.org>
Thu, 13 Dec 2007 06:26:31 +0000 (06:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 13 Dec 2007 06:26:31 +0000 (06:26 -0000)
svn path=/main/branches/2.1.2/; revision=8900

bin/emerge
pym/portage.py

index aee37cea58bb74e933348f0854338739d5b78cb6..93d9070a62acb4cb2b8495cb7e9f90f32c5e22b2 100755 (executable)
@@ -1902,10 +1902,12 @@ class depgraph:
                                        usepkgonly = "--usepkgonly" in self.myopts
                                        chost = pkgsettings["CHOST"]
                                        myeb_pkg_matches = []
-                                       bindb_keys = ["CHOST","EAPI"]
+                                       bindb_keys = list(bindb._aux_cache_keys)
                                        for pkg in bindb.match(x):
                                                metadata = dict(izip(bindb_keys,
                                                        bindb.aux_get(pkg, bindb_keys)))
+                                               if not metadata["SLOT"]:
+                                                       continue
                                                if chost != metadata["CHOST"]:
                                                        continue
                                                if not portage.eapi_is_supported(metadata["EAPI"]):
@@ -2014,9 +2016,18 @@ class depgraph:
                                                        print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.")
                                                        print "!!! One of the following masked packages is required to complete your request:"
                                                        oldcomment = ""
+                                                       db_keys = list(portdb._aux_cache_keys)
                                                        for p in alleb:
+                                                               metadata = None
                                                                mreasons = portage.getmaskingstatus(p,
                                                                        settings=pkgsettings, portdb=portdb)
+                                                               try:
+                                                                       metadata = dict(izip(db_keys,
+                                                                               portdb.aux_get(p, db_keys)))
+                                                               except KeyError:
+                                                                       pass
+                                                               if metadata and not metadata["SLOT"]:
+                                                                       mreasons.append("invalid: SLOT is undefined")
                                                                print "- "+p+" (masked by: "+", ".join(mreasons)+")"
                                                                comment, filename = portage.getmaskingreason(p,
                                                                        settings=pkgsettings, portdb=portdb, return_location=True)
@@ -2024,13 +2035,7 @@ class depgraph:
                                                                        print filename+":"
                                                                        print comment
                                                                        oldcomment = comment
-                                                               try:
-                                                                       aux_keys = list(portdb._aux_cache_keys)
-                                                                       metadata = dict(izip(aux_keys,
-                                                                               portdb.aux_get(p, aux_keys)))
-                                                               except KeyError:
-                                                                       pass
-                                                               else:
+                                                               if metadata:
                                                                        if not portage.eapi_is_supported(
                                                                                metadata["EAPI"]):
                                                                                have_eapi_mask = True
@@ -2050,7 +2055,7 @@ class depgraph:
                                                        alleb = bindb.match(x)
                                                        if alleb:
                                                                chost = pkgsettings["CHOST"]
-                                                               bindb_keys = ["CHOST","EAPI"]
+                                                               bindb_keys = list(bindb._aux_cache_keys)
                                                                for p in alleb:
                                                                        mreasons = []
                                                                        metadata = dict(izip(bindb_keys,
@@ -2058,6 +2063,8 @@ class depgraph:
                                                                        if chost != metadata["CHOST"]:
                                                                                mreasons.append("CHOST: %s" % \
                                                                                        metadata["CHOST"])
+                                                                       if not metadata["SLOT"]:
+                                                                               mreasons.append("invalid: SLOT is undefined")
                                                                        if not portage.eapi_is_supported(
                                                                                metadata["EAPI"]):
                                                                                have_eapi_mask = True
index 01a2736d360391e8df73b30dfb3c4cd5246f976a..07a01d7c3b56f0a9082a7f6a4484bdbb1dfc3f90 100644 (file)
@@ -7267,6 +7267,8 @@ class portdbapi(dbapi):
                        except KeyError:
                                # masked by corruption
                                continue
+                       if not metadata["SLOT"]:
+                               continue
                        if getMaskAtom(cpv, metadata):
                                continue
                        if getProfileMaskAtom(cpv, metadata):