Only enable --rebuilt-binaries automatically if --update and --deep are also
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:31:29 +0000 (20:31 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:31:29 +0000 (20:31 -0000)
enabled. (trunk r15372)

svn path=/main/branches/2.1.7/; revision=15599

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

index b0ea2d8d38d1833292de376731f2d7f94364c997..9a7526e45e5b0cb02e7e1d5cc778b05f7f07e105 100644 (file)
@@ -474,8 +474,9 @@ display it on stdout.
 Replace installed packages with binary packages that have
 been rebuilt. Rebuilds are detected by comparison of
 BUILD_TIME package metadata. This option is enabled
-automatically when using binary packages (see
-\fB\-\-usepkg\fR and \fB\-\-getbinpkg\fR).
+automatically when using binary packages
+(\fB\-\-usepkg\fR or \fB\-\-getbinpkg\fR) together with
+\fB\-\-update\fR and \fB\-\-deep\fR.
 .TP
 .BR "\-\-reinstall changed\-use"
 Tells emerge to include installed packages where USE flags have
index 188dc6f967d6bc22102181d9d9cbdede467c343f..37bda4922c8f197ab4a097d64ac6d7e83ccf7185 100644 (file)
@@ -15,6 +15,7 @@ def create_depgraph_params(myopts, myaction):
        # empty:     pretend nothing is merged
        # complete:  completely account for all known dependencies
        # remove:    build graph for use in removing packages
+       # rebuilt_binaries: replace installed packages with rebuilt binaries
        myparams = {"recurse" : True}
 
        if myaction == "remove":
@@ -37,6 +38,15 @@ def create_depgraph_params(myopts, myaction):
                myparams["deep"] = myopts["--deep"]
        if "--complete-graph" in myopts:
                myparams["complete"] = True
+
+       rebuilt_binaries = myopts.get('--rebuilt-binaries')
+       if rebuilt_binaries is True or \
+               rebuilt_binaries != 'n' and \
+               '--usepkg' in myopts and \
+               myopts.get('--deep') is True and \
+               '--update' in myopts:
+               myparams['rebuilt_binaries'] = True
+
        if myopts.get("--selective") == "n":
                # --selective=n can be used to remove selective
                # behavior that may have been implied by some
index 1986a0b22346e39102e817dcf6f5358a31ddb3bf..cd71c91057cea14672a12cef53d2b3aa3b432dd6 100644 (file)
@@ -2396,9 +2396,7 @@ class depgraph(object):
                atom_set = InternalPackageSet(initial_atoms=(atom,))
                existing_node = None
                myeb = None
-               usepkg = "--usepkg" in self._frozen_config.myopts
-               rebuilt_binaries = usepkg and \
-                       self._frozen_config.myopts.get('--rebuilt-binaries') != 'n'
+               rebuilt_binaries = 'rebuilt_binaries' in self._dynamic_config.myparams
                usepkgonly = "--usepkgonly" in self._frozen_config.myopts
                empty = "empty" in self._dynamic_config.myparams
                selective = "selective" in self._dynamic_config.myparams
index c277599ca29e31b4936bbf67406ea4b9b71ae42e..57494be39bc4a728e063e1b0f69e721de16a7c36 100644 (file)
@@ -507,8 +507,9 @@ def help(myopts, havecolor=1):
                desc = "Replace installed packages with binary packages that have " + \
                        "been rebuilt. Rebuilds are detected by comparison of " + \
                        "BUILD_TIME package metadata. This option is enabled " + \
-                       "automatically when using binary packages (see " + \
-                       "--usepkg and --getbinpkg)."
+                       "automatically when using binary packages " + \
+                       "(--usepkg or --getbinpkg) together with " + \
+                       "--update and --deep."
                for line in wrap(desc, desc_width):
                        print(desc_indent + line)
                print()
index 7d1c2c7e223e2e0ea9c823dc541719c1d17697f7..f4d223b67b8ed64cc938cd4f8a543b6cd5edee35 100644 (file)
@@ -663,8 +663,7 @@ def parse_opts(tmpcmdline, silent=False):
                myoptions.keep_going = None
 
        if myoptions.rebuilt_binaries in ("True",):
-               # The depgraph will enable this by default unless 'n' is specified.
-               myoptions.rebuilt_binaries = None
+               myoptions.rebuilt_binaries = True
 
        if myoptions.root_deps == "True":
                myoptions.root_deps = True