Use Package.visible to simplify visibility checks for installed
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Aug 2010 02:07:09 +0000 (19:07 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Aug 2010 02:07:09 +0000 (19:07 -0700)
packages, no that it accounts for invalid metadata.

pym/_emerge/depgraph.py

index effb2e541566156c70beea05d4d1906a5cf4ab3e..69ba8b2cc1a1d49e3d36002e7d62dfe432bd0875 100644 (file)
@@ -2616,17 +2616,7 @@ class depgraph(object):
                                        # Make --noreplace take precedence over --newuse.
                                        if not pkg.installed and noreplace and \
                                                cpv in vardb.match(atom):
-                                               inst_pkg = self._pkg(pkg.cpv, "installed",
-                                                       root_config, installed=True)
-                                               mreasons = None
-                                               if not inst_pkg.invalid:
-                                                       mreasons = _get_masking_status(inst_pkg,
-                                                               pkgsettings, root_config,
-                                                               use=self._pkg_use_enabled(inst_pkg))
-                                                       if mreasons and len(mreasons) == 1 and \
-                                                               mreasons[0].category  == 'KEYWORDS':
-                                                               mreasons = None
-                                               if not inst_pkg.invalid and not mreasons:
+                                               if inst_pkg.visible:
                                                        # If the installed version is masked, it may
                                                        # be necessary to look at lower versions,
                                                        # in case there is a visible downgrade.