From e559940e19ac2d32109df4b275ea9744e57171e9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 10 Feb 2008 23:39:16 +0000 Subject: [PATCH] Bug #209538 - Disable annoying "masked by keyword" warnings for installed 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 | 4 ++-- pym/portage.py | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/emerge b/bin/emerge index 51b1a56df..2863b10d0 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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 \ diff --git a/pym/portage.py b/pym/portage.py index e27e30a3d..b63105cac 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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 -- 2.26.2