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

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

bin/emerge
pym/portage.py

index 51b1a56df8c2a6d13e18b6e6d77b42ec3f5f30c0..2863b10d055300d42c049fc19ab5cfb1e28cf803 100755 (executable)
@@ -1139,7 +1139,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
@@ -1150,7 +1150,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 e27e30a3d5e2455954708c052b6e08ae6a104f05..b63105cace78ad20d31054a764ea529e24c5ae47 100644 (file)
@@ -5665,11 +5665,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)
@@ -5750,7 +5760,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")
        return rValue