From ae66b19d3a06cefb7a765f5e7af2d16026bfdcc9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 20 Nov 2007 19:30:17 +0000 Subject: [PATCH] For unsatisfied dependencies, shorten the per-package EAPI mask 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 | 27 +++++++++++++++++++++++---- pym/portage.py | 2 +- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/bin/emerge b/bin/emerge index 7eb9fbeab..70bb6403e 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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." diff --git a/pym/portage.py b/pym/portage.py index 5fc82faff..90cecbfec 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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() -- 2.26.2