summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-02-18 21:50:53 +0000
committerZac Medico <zmedico@gentoo.org>2010-02-18 21:50:53 +0000
commit1366d50fd4a6f70f60b156fbd39751ae1d3aab21 (patch)
treecd2f35bc5993ae1e90a8b9e85e81171ea1aea4a7
parentRemove unused merge_cmd variable. (diff)
downloadportage-idfetch-1366d50fd4a6f70f60b156fbd39751ae1d3aab21.tar.gz
portage-idfetch-1366d50fd4a6f70f60b156fbd39751ae1d3aab21.tar.bz2
portage-idfetch-1366d50fd4a6f70f60b156fbd39751ae1d3aab21.zip
Only enable --rebuilt-binaries automatically if --update and --deep are also
enabled. svn path=/main/trunk/; revision=15372
-rw-r--r--man/emerge.15
-rw-r--r--pym/_emerge/create_depgraph_params.py10
-rw-r--r--pym/_emerge/depgraph.py4
-rw-r--r--pym/_emerge/help.py5
-rw-r--r--pym/_emerge/main.py3
5 files changed, 18 insertions, 9 deletions
diff --git a/man/emerge.1 b/man/emerge.1
index 6c2727de..3b2986cc 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -481,8 +481,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
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py
index 188dc6f9..37bda492 100644
--- a/pym/_emerge/create_depgraph_params.py
+++ b/pym/_emerge/create_depgraph_params.py
@@ -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
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 74cc4f0e..aec61bd5 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -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
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index afdaa1ca..7c6b334f 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -510,8 +510,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()
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index a92ae035..fa564b18 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -741,8 +741,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