From 7deee1551ab2bfdabdadde71a8494b3710f689f3 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 13 Dec 2007 06:26:31 +0000 Subject: [PATCH] Bug #201848 - Mask ebuilds that do not define SLOT. (trunk r8894) svn path=/main/branches/2.1.2/; revision=8900 --- bin/emerge | 25 ++++++++++++++++--------- pym/portage.py | 2 ++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/bin/emerge b/bin/emerge index aee37cea5..93d9070a6 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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 diff --git a/pym/portage.py b/pym/portage.py index 01a2736d3..07a01d7c3 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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): -- 2.26.2