diff options
-rw-r--r-- | pym/_emerge/__init__.py | 4 | ||||
-rw-r--r-- | pym/portage/__init__.py | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 105168870..462410c3b 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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 \ diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 741c99078..8bc7a8c82 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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: |