Bug #276866 - --binpkg-respect-use < y | n >
authorZac Medico <zmedico@gentoo.org>
Tue, 7 Jul 2009 08:52:08 +0000 (08:52 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 7 Jul 2009 08:52:08 +0000 (08:52 -0000)
Tells emerge to ignore binary packages if their use flags don't match the
current configuration. (default: ´n´)
Thanks to Sebastian Mingramm (few) <s.mingramm@gmx.de> for this patch
(small tweaks by me).

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

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

index 615ad5e82d5b8ab5c4902598a07454d2aaf2ee8c..b533857bb1526cfb333ea18cca561821e5155370 100644 (file)
@@ -249,6 +249,10 @@ it is interpreted as acceptance of the first choice.  Note that the input
 buffer is not cleared prior to the prompt, so an accidental press of the
 "Enter" key at any time prior to the prompt will be interpreted as a choice!\fR
 .TP
+.BR "\-\-binpkg\-respect\-use < y | n >"
+Tells emerge to ignore binary packages if their use flags
+don't match the current configuration. (default: \'n\')
+.TP
 .BR "\-\-buildpkg " (\fB\-b\fR)
 Tells emerge to build binary packages for all ebuilds processed in
 addition to actually merging the packages.  Useful for maintainers
index c02e50ca488de7f9668feb4da37e5e0f4792c8d8..61edea2a8afb11c62e96c4a34c0703a7eaeded49 100644 (file)
@@ -572,7 +572,8 @@ class depgraph(object):
                orig_use, orig_iuse, cur_use, cur_iuse):
                """Return a set of flags that trigger reinstallation, or None if there
                are no such flags."""
-               if "--newuse" in self._frozen_config.myopts:
+               if "--newuse" in self._frozen_config.myopts or \
+                       "--binpkg-respect-use" in self._frozen_config.myopts:
                        flags = set(orig_iuse.symmetric_difference(
                                cur_iuse).difference(forced_flags))
                        flags.update(orig_iuse.intersection(orig_use).symmetric_difference(
@@ -2155,7 +2156,8 @@ class depgraph(object):
                                        # reject the built package if necessary.
                                        if built and not installed and \
                                                ("--newuse" in self._frozen_config.myopts or \
-                                               "--reinstall" in self._frozen_config.myopts):
+                                               "--reinstall" in self._frozen_config.myopts or \
+                                               "--binpkg-respect-use" in self._frozen_config.myopts):
                                                iuses = pkg.iuse.all
                                                old_use = pkg.use.enabled
                                                if myeb:
index 34a4bda290cd30babc18192a560d261ccea71d29..f78c2e0e0f1887f39987e1082d7088d845692585 100644 (file)
@@ -249,6 +249,13 @@ def help(myopts, havecolor=1):
                print "              to the prompt, so an accidental press of the \"Enter\" key at any"
                print "              time prior to the prompt will be interpreted as a choice!"
                print
+               print "        " + green("--binpkg-respect-use") + \
+                       " < " + turquoise("y") + " | " + turquoise("n") + " >"
+               desc = "Tells emerge to ignore binary packages if their use flags" + \
+                       " don't match the current configuration. (default: 'n')"
+               for line in wrap(desc, desc_width):
+                       print desc_indent + line
+               print
                print "       "+green("--buildpkg")+" ("+green("-b")+" short option)"
                desc = "Tells emerge to build binary packages for all ebuilds processed in" + \
                        " addition to actually merging the packages. Useful for maintainers" + \
index a2c48554bd044543fd9121263dbed250f2f932a5..4826796299beeda25653d7fb8f46b51fbcd9fe22 100644 (file)
@@ -368,6 +368,7 @@ def insert_optional_args(args):
        jobs_opts = ("-j", "--jobs")
        default_arg_opts = {
                '--deselect'   : ('n',),
+               '--binpkg-respect-use'   : ('n', 'y',),
                '--root-deps'  : ('rdeps',),
        }
        arg_stack = args[:]
@@ -486,6 +487,14 @@ def parse_opts(tmpcmdline, silent=False):
                        "type":"choice",
                        "choices":["changed-use"]
                },
+
+               "--binpkg-respect-use": {
+                       "help"    : "discard binary packages if their use flags \
+                               don't match the current configuration",
+                       "type"    : "choice",
+                       "choices" : ("True", "y", "n")
+               },
+
                "--root": {
                 "help"   : "specify the target root filesystem for merging packages",
                 "action" : "store"
@@ -527,6 +536,11 @@ def parse_opts(tmpcmdline, silent=False):
        if myoptions.deselect == "True":
                myoptions.deselect = True
 
+       if myoptions.binpkg_respect_use in ("y", "True",):
+               myoptions.binpkg_respect_use = True
+       else:
+               myoptions.binpkg_respect_use = None
+
        if myoptions.root_deps == "True":
                myoptions.root_deps = True