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
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 \
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)
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