composite_db: use ebuild visibility for installed
authorZac Medico <zmedico@gentoo.org>
Wed, 5 Jan 2011 00:52:32 +0000 (16:52 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 5 Jan 2011 01:04:05 +0000 (17:04 -0800)
This will fix bug #350488.

pym/_emerge/depgraph.py
pym/_emerge/main.py

index ac7f45239b07d93ad37767c83ddfb483b73453e1..46fca20d82aec72f5c6cdb361d9b97d397ab8356 100644 (file)
@@ -5411,7 +5411,22 @@ class _dep_check_composite_db(dbapi):
                        # that are usually ignored in visibility checks for
                        # installed packages, in order to handle cases like
                        # bug #350285.
-                       return False
+                       myopts = self._depgraph._frozen_config.myopts
+                       use_ebuild_visibility = myopts.get(
+                               '--use-ebuild-visibility', 'n') != 'n'
+                       usepkgonly = "--usepkgonly" in myopts
+                       if not use_ebuild_visibility and usepkgonly:
+                               return False
+                       else:
+                               try:
+                                       pkg_eb = self._depgraph._pkg(
+                                               pkg.cpv, "ebuild", pkg.root_config)
+                               except portage.exception.PackageNotFound:
+                                       return False
+                               else:
+                                       if not self._depgraph._pkg_visibility_check(pkg_eb):
+                                               return False
+
                in_graph = self._depgraph._dynamic_config._slot_pkg_map[
                        self._root].get(pkg.slot_atom)
                if in_graph is None:
index 5179097d604614214a7bb0d8195a0f22da415070..e26aa659581cbbeb61ca3c9d900812dba6246b93 100644 (file)
@@ -937,7 +937,8 @@ def parse_opts(tmpcmdline, silent=False):
        if myoptions.use_ebuild_visibility in true_y:
                myoptions.use_ebuild_visibility = True
        else:
-               myoptions.use_ebuild_visibility = None
+               # None or "n"
+               pass
 
        if myoptions.usepkg in true_y:
                myoptions.usepkg = True