summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-07-19 01:36:58 -0700
committerZac Medico <zmedico@gentoo.org>2011-07-19 01:36:58 -0700
commit72f83d8078da7aab7be9236b86be1526c15a4185 (patch)
tree26f6344413472b07e4e2e08f349b19941dd6b0a4
parent092803df76a6112279b06f05f75a95b3285a97ea (diff)
downloadportage-72f83d8078da7aab7be9236b86be1526c15a4185.tar.gz
portage-72f83d8078da7aab7be9236b86be1526c15a4185.tar.bz2
portage-72f83d8078da7aab7be9236b86be1526c15a4185.zip
Make emerge --noreplace identical to --selective.
This removes a very subtle difference in --noreplace package selection logic which is not very useful and triggers strange package selection choices in some cases, as reported in bug #375571.
-rw-r--r--man/emerge.18
-rw-r--r--pym/_emerge/actions.py8
-rw-r--r--pym/_emerge/depgraph.py11
-rw-r--r--pym/_emerge/help.py9
-rw-r--r--pym/_emerge/main.py3
5 files changed, 8 insertions, 31 deletions
diff --git a/man/emerge.1 b/man/emerge.1
index df576ee10..4a19bdb26 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -488,10 +488,7 @@ Skips the packages specified on the command\-line that have already
been installed. Without this option, any packages, ebuilds, or deps
you specify on the command\-line \fBwill\fR cause Portage to remerge
the package, even if it is already installed. Note that Portage will
-not remerge dependencies by default. Also note that this option takes
-precedence over options such as \fB\-\-newuse\fR, preventing a package
-from being reinstalled even though the corresponding USE flag settings
-may have changed.
+not remerge dependencies by default.
.TP
.BR "\-\-nospinner"
Disables the spinner for the session. The spinner is active when the
@@ -619,8 +616,7 @@ use \fBEMERGE_DEFAULT_OPTS\fR to make
\fB\-\-oneshot\fR behavior default.
.TP
.BR "\-\-selective [ y | n ]"
-This is similar to the \fB\-\-noreplace\fR option, except that it
-does not take precedence over options such as \fB\-\-newuse\fR.
+This is identical to the \fB\-\-noreplace\fR option.
Some options, such as \fB\-\-update\fR, imply \fB\-\-selective\fR.
Use \fB\-\-selective=n\fR if you want to forcefully disable
\fB\-\-selective\fR, regardless of options like \fB\-\-update\fR.
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index f6c2721fa..219ed7101 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -163,6 +163,8 @@ def action_build(settings, trees, mtimedb,
debug = "--debug" in myopts
verbose = "--verbose" in myopts
quiet = "--quiet" in myopts
+ myparams = create_depgraph_params(myopts, myaction)
+
if pretend or fetchonly:
# make the mtimedb readonly
mtimedb.filename = None
@@ -187,7 +189,6 @@ def action_build(settings, trees, mtimedb,
favorites = mtimedb["resume"].get("favorites")
if not isinstance(favorites, list):
favorites = []
- myparams = create_depgraph_params(myopts, myaction)
resume_data = mtimedb["resume"]
mergelist = resume_data["mergelist"]
@@ -286,7 +287,6 @@ def action_build(settings, trees, mtimedb,
print(darkgreen("emerge: It seems we have nothing to resume..."))
return os.EX_OK
- myparams = create_depgraph_params(myopts, myaction)
try:
success, mydepgraph, favorites = backtrack_depgraph(
settings, trees, myopts, myparams, myaction, myfiles, spinner)
@@ -331,7 +331,7 @@ def action_build(settings, trees, mtimedb,
if mergecount==0:
sets = trees[settings["ROOT"]]["root_config"].sets
world_candidates = None
- if "--noreplace" in myopts and \
+ if "selective" in myparams and \
not oneshot and favorites:
# Sets that are not world candidates are filtered
# out here since the favorites list needs to be
@@ -340,7 +340,7 @@ def action_build(settings, trees, mtimedb,
world_candidates = [x for x in favorites \
if not (x.startswith(SETPREFIX) and \
not sets[x[1:]].world_candidate)]
- if "--noreplace" in myopts and \
+ if "selective" in myparams and \
not oneshot and world_candidates:
print()
for x in world_candidates:
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index a5923ddf6..9e3064d25 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3591,7 +3591,6 @@ class depgraph(object):
empty = "empty" in self._dynamic_config.myparams
selective = "selective" in self._dynamic_config.myparams
reinstall = False
- noreplace = "--noreplace" in self._frozen_config.myopts
avoid_update = "--update" not in self._frozen_config.myopts
dont_miss_updates = "--update" in self._frozen_config.myopts
use_ebuild_visibility = self._frozen_config.myopts.get(
@@ -3679,16 +3678,6 @@ class depgraph(object):
continue
cpv = pkg.cpv
- # Make --noreplace take precedence over --newuse.
- if not pkg.installed and noreplace and \
- cpv in vardb.match(atom):
- inst_pkg = self._pkg(pkg.cpv, "installed",
- root_config, installed=True)
- if inst_pkg.visible:
- # If the installed version is masked, it may
- # be necessary to look at lower versions,
- # in case there is a visible downgrade.
- continue
reinstall_for_flags = None
if not pkg.installed or \
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index 5b5658d9f..c978ce255 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -565,12 +565,6 @@ def help(myopts, havecolor=1):
print(" ebuilds, or deps you specify on the command-line *will* cause")
print(" Portage to remerge the package, even if it is already installed.")
print(" Note that Portage won't remerge dependencies by default.")
- desc = "Also note that this option takes " + \
- "precedence over options such as --newuse, preventing a package " + \
- "from being reinstalled even though the corresponding USE flag settings " + \
- "may have changed."
- for line in wrap(desc, desc_width):
- print(desc_indent + line)
print()
print(" "+green("--nospinner"))
print(" Disables the spinner regardless of terminal type.")
@@ -733,8 +727,7 @@ def help(myopts, havecolor=1):
print()
print(" " + green("--selective") + " [ %s | %s ]" % \
(turquoise("y"), turquoise("n")))
- desc = "This is similar to the --noreplace option, except that it " + \
- "does not take precedence over options such as --newuse. " + \
+ desc = "This identical to the --noreplace option. " + \
"Some options, such as --update, imply --selective. " + \
"Use --selective=n if you want to forcefully disable " + \
"--selective, regardless of options like --update."
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 42ce81069..11a33149d 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -842,8 +842,7 @@ def parse_opts(tmpcmdline, silent=False):
},
"--selective": {
- "help" : "similar to the --noreplace but does not take " + \
- "precedence over options such as --newuse",
+ "help" : "identical to --noreplace",
"type" : "choice",
"choices" : true_y_or_n
},