Add a --use-ebuild-visibility option, for using unbuilt ebuild metadata
authorZac Medico <zmedico@gentoo.org>
Sun, 18 Oct 2009 08:29:59 +0000 (08:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 18 Oct 2009 08:29:59 +0000 (08:29 -0000)
in visibility checks for built ebuilds. Thanks to Sebastian Mingramm (few)
for reporting the problem and testing the patch.

svn path=/main/trunk/; revision=14665

man/emerge.1
pym/_emerge/depgraph.py
pym/_emerge/help.py
pym/_emerge/main.py

index c516755f3c3d19cd60f49ca9c61a0b760195a551..34fbe6459aa64b7eafbf301dca5cb0ff3db43ecb 100644 (file)
@@ -501,6 +501,10 @@ Shows the dependency tree for the given target by indenting dependencies.
 This is only really useful in combination with \fB\-\-emptytree\fR or 
 \fB\-\-update\fR and \fB\-\-deep\fR.
 .TP
+.BR "\-\-use\-ebuild\-visibility[=n]"
+Use unbuilt ebuild metadata for visibility
+checks on built packages.
+.TP
 .BR "\-\-usepkg[=n] " (\fB\-k\fR) 
 Tells emerge to use binary packages (from $PKGDIR) if they are available, thus 
 possibly avoiding some time\-consuming compiles.  This option is useful for CD 
index de60bd801146672ee53caf40369fff644438a54e..3d9df88902e57c6e8137bda30ae0a4de739f6ae7 100644 (file)
@@ -2319,6 +2319,8 @@ class depgraph(object):
                reinstall = False
                noreplace = "--noreplace" in self._frozen_config.myopts
                avoid_update = "--update" not in self._frozen_config.myopts
+               use_ebuild_visibility = self._frozen_config.myopts.get(
+                       '--use-ebuild-visibility', 'n') != 'n'
                # Behavior of the "selective" parameter depends on
                # whether or not a package matches an argument atom.
                # If an installed package provides an old-style
@@ -2392,7 +2394,7 @@ class depgraph(object):
                                                                # instances (installed or binary).
                                                                # If --usepkgonly is enabled, assume that
                                                                # the ebuild status should be ignored.
-                                                               if usepkgonly:
+                                                               if not use_ebuild_visibility and usepkgonly:
                                                                        if installed and \
                                                                                pkgsettings._getMissingKeywords(
                                                                                pkg.cpv, pkg.metadata):
index bbeb2fb365dffe584a950984e51b245de0adba02..346d77712a387ce19921aea36dad000ab4eb9a98 100644 (file)
@@ -538,6 +538,12 @@ def help(myopts, havecolor=1):
                print("              a package's dependencies follow the package. Only really useful")
                print("              in combination with --emptytree, --update or --deep.")
                print()
+               print("       " + green("--use-ebuild-visibility") + "[=%s]" % turquoise("n"))
+               desc = "Use unbuilt ebuild metadata for visibility " + \
+                       "checks on built packages."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
+               print()
                print("       "+green("--usepkg")+ "[=%s]" % turquoise("n") + " ("+green("-k")+" short option)")
                print("              Tell emerge to use binary packages (from $PKGDIR) if they are")
                print("              available, thus possibly avoiding some time-consuming compiles.")
index f8a8b6b46b04aeff3d57cc2f6b4947a52aac600d..535cb2dddc43b6ca4ba51634d0c434032478a634 100644 (file)
@@ -391,6 +391,7 @@ def insert_optional_args(args):
                '--root-deps'  : ('rdeps',),
                '--select'               : ('n',),
                '--selective'            : ('n',),
+               "--use-ebuild-visibility": ('n',),
                '--usepkg'               : ('n',),
                '--usepkgonly'           : ('n',),
        }
@@ -628,6 +629,12 @@ def parse_opts(tmpcmdline, silent=False):
                        "choices" : ("True", "n")
                },
 
+               "--use-ebuild-visibility": {
+                       "help"     : "use unbuilt ebuild metadata for visibility checks on built packages",
+                       "type"     : "choice",
+                       "choices"  : ("True", "n")
+               },
+
                "--usepkg": {
                        "shortopt" : "-k",
                        "help"     : "use binary packages",
@@ -771,6 +778,11 @@ def parse_opts(tmpcmdline, silent=False):
 
                myoptions.load_average = load_average
 
+       if myoptions.use_ebuild_visibility in ("True",):
+               myoptions.use_ebuild_visibility = True
+       else:
+               myoptions.use_ebuild_visibility = None
+
        if myoptions.usepkg in ("True",):
                myoptions.usepkg = True
        else: