Bug #209538 - Disable annoying "masked by keyword" warnings for installed
authorZac Medico <zmedico@gentoo.org>
Sun, 10 Feb 2008 23:32:04 +0000 (23:32 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 10 Feb 2008 23:32:04 +0000 (23:32 -0000)
packages. We can assume that if the user accepted the keywords at merge
time then they never want to be bothered again.

svn path=/main/trunk/; revision=9330

pym/_emerge/__init__.py
pym/portage/__init__.py

index 105168870d025a0ae7f1de5734560b3c0b02bb82..462410c3be9a9f174229902f984af0de886917a4 100644 (file)
@@ -1022,7 +1022,7 @@ def visible(pkgsettings, cpv, metadata, built=False, installed=False):
                return False
        if not portage.eapi_is_supported(metadata["EAPI"]):
                return False
-       if pkgsettings.getMissingKeywords(cpv, metadata):
+       if not installed and pkgsettings.getMissingKeywords(cpv, metadata):
                return False
        if pkgsettings.getMaskAtom(cpv, metadata):
                return False
@@ -1035,7 +1035,7 @@ def visible(pkgsettings, cpv, metadata, built=False, installed=False):
 def get_masking_status(pkg, pkgsettings, root_config):
 
        mreasons = portage.getmaskingstatus(
-               pkg.cpv, metadata=pkg.metadata, settings=pkgsettings,
+               pkg, settings=pkgsettings,
                portdb=root_config.trees["porttree"].dbapi)
 
        if pkg.built and not pkg.installed and \
index 741c99078b9f5adcd022386774177176b1efb623..8bc7a8c82f4c824a0aeede42d744e5c9b4e572e3 100644 (file)
@@ -5690,11 +5690,21 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo
        else:
                return None
 
-def getmaskingstatus(mycpv, metadata=None, settings=None, portdb=None):
+def getmaskingstatus(mycpv, settings=None, portdb=None):
        if settings is None:
                settings = config(clone=globals()["settings"])
        if portdb is None:
                portdb = globals()["portdb"]
+
+       metadata = None
+       installed = False
+       if not isinstance(mycpv, basestring):
+               # emerge passed in a Package instance
+               pkg = mycpv
+               mycpv = pkg.cpv
+               metadata = pkg.metadata
+               installed = pkg.installed
+
        mysplit = catpkgsplit(mycpv)
        if not mysplit:
                raise ValueError("invalid CPV: %s" % mycpv)
@@ -5784,7 +5794,9 @@ def getmaskingstatus(mycpv, metadata=None, settings=None, portdb=None):
                                kmask="~"+myarch
                                break
 
-       if kmask:
+       # Assume that the user doesn't want to be bothered about
+       # KEYWORDS of packages that are already installed.
+       if kmask and not installed:
                rValue.append(kmask+" keyword")
 
        try: