summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-11 09:20:51 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-11 09:20:51 +0000
commitbc52dae15c19191b9f54d565568143158e40ef64 (patch)
tree99a05105bf0235e3f63f1484b928639dea4e364b
parentUse spawn() instead of system(). (trunk r10642) (diff)
downloadportage-multirepo-bc52dae15c19191b9f54d565568143158e40ef64.tar.gz
portage-multirepo-bc52dae15c19191b9f54d565568143158e40ef64.tar.bz2
portage-multirepo-bc52dae15c19191b9f54d565568143158e40ef64.zip
Bug #225767 - Suppress warnings for installed packages masked by keywords
if there is an equivalent ebuild in the portage tree (same cpv) with visible keywords. (trunk r10643:10646) svn path=/main/branches/2.1.2/; revision=10647
-rwxr-xr-xbin/emerge40
1 files changed, 39 insertions, 1 deletions
diff --git a/bin/emerge b/bin/emerge
index 6b11bacf..b7a3c153 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -3524,6 +3524,32 @@ class depgraph(object):
return 0
return 1
+ def _pkg(self, cpv, type_name, root_config, installed=False):
+ """
+ Get a package instance from the cache, or create a new
+ one if necessary. Raises KeyError from aux_get if it
+ failures for some reason (package does not exist or is
+ corrupt).
+ """
+ operation = "merge"
+ if installed:
+ operation = "nomerge"
+ pkg = self._pkg_cache.get(
+ (type_name, root_config.root, cpv, operation))
+ if pkg is None:
+ db = root_config.trees[
+ self.pkg_tree_map[type_name]].dbapi
+ metadata = izip(Package.metadata_keys,
+ db.aux_get(cpv, Package.metadata_keys))
+ pkg = Package(cpv=cpv, metadata=metadata,
+ root_config=root_config)
+ if type_name == "ebuild":
+ settings = self.pkgsettings[root_config.root]
+ settings.setcpv(pkg)
+ pkg.metadata["USE"] = settings["PORTAGE_USE"]
+ self._pkg_cache[pkg] = pkg
+ return pkg
+
def validate_blockers(self):
"""Remove any blockers from the digraph that do not match any of the
packages within the graph. If necessary, create hard deps to ensure
@@ -3591,7 +3617,19 @@ class depgraph(object):
pkg.cpv, pkg.metadata) and \
pkg.metadata["KEYWORDS"].split() and \
not pkg_in_graph:
- self._masked_installed.add(pkg)
+ try:
+ ebuild = self._pkg(pkg.cpv,
+ "ebuild", pkg.root_config)
+ except KeyError:
+ ebuild = None
+ else:
+ try:
+ if not visible(pkgsettings, ebuild):
+ ebuild = None
+ except portage_exception.InvalidDependString:
+ ebuild = None
+ if ebuild is None:
+ self._masked_installed.add(pkg)
blocker_atoms = None
blockers = None