For unsatisfied dependencies, shorten the per-package EAPI mask
authorZac Medico <zmedico@gentoo.org>
Tue, 20 Nov 2007 19:30:17 +0000 (19:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 20 Nov 2007 19:30:17 +0000 (19:30 -0000)
output and show an informative message whenever an EAPI mask is
encountered. (trunk r8457)

svn path=/main/branches/2.1.2/; revision=8544

bin/emerge
pym/portage.py

index 7eb9fbeabe24169524e3720b3700133aeeb54c9d..70bb6403ea40c52b3ad011eafe9dd9d995f8b99b 100755 (executable)
@@ -1981,6 +1981,8 @@ class depgraph:
                                                        green('"%s"' % myparent[2]) + \
                                                        red(' [%s]' % myparent[0]) + ')'
                                        alleb = portdb.xmatch("match-all", x)
+                                       from textwrap import wrap
+                                       have_eapi_mask = False
                                        if alleb:
                                                if "--usepkgonly" not in self.myopts:
                                                        print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.")
@@ -1996,6 +1998,24 @@ 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 not portage.eapi_is_supported(
+                                                                               metadata["EAPI"]):
+                                                                               have_eapi_mask = True
+                                                       if have_eapi_mask:
+                                                               print
+                                                               msg = ("The current version of portage supports " + \
+                                                                       "EAPI '%s'. You must upgrade to a newer version" + \
+                                                                       " of portage before EAPI masked packages can" + \
+                                                                       " be installed.") % portage_const.EAPI
+                                                               for line in wrap(msg, 75):
+                                                                       print line
                                                        print
                                                        print "For more information, see MASKED PACKAGES section in the emerge man page or "
                                                        print "refer to the Gentoo Handbook."
@@ -2014,10 +2034,9 @@ class depgraph:
                                                                                        metadata["CHOST"])
                                                                        if not portage.eapi_is_supported(
                                                                                metadata["EAPI"]):
-                                                                               mreasons.append(("required EAPI %s" + \
-                                                                                       ", supported EAPI %s") % \
-                                                                                       (metadata["EAPI"],
-                                                                                       portage_const.EAPI))
+                                                                               have_eapi_mask = True
+                                                                               mreasons.append(
+                                                                                       "EAPI %s" % metadata["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 5fc82faff49f731c5669c4701f0274b9c1dbc47a..90cecbfec8c5be2bf372680f463346dde6d533ca 100644 (file)
@@ -5231,7 +5231,7 @@ def getmaskingstatus(mycpv, settings=None, portdb=None):
        if eapi.startswith("-"):
                eapi = eapi[1:]
        if not eapi_is_supported(eapi):
-               return ["required EAPI %s, supported EAPI %s" % (eapi, portage_const.EAPI)]
+               return ["EAPI %s" % eapi]
        egroups = settings.configdict["backupenv"].get(
                "ACCEPT_KEYWORDS", "").split()
        mygroups = mygroups.split()