From 72f83d8078da7aab7be9236b86be1526c15a4185 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 19 Jul 2011 01:36:58 -0700 Subject: 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. --- pym/_emerge/actions.py | 8 ++++---- pym/_emerge/depgraph.py | 11 ----------- pym/_emerge/help.py | 9 +-------- pym/_emerge/main.py | 3 +-- 4 files changed, 6 insertions(+), 25 deletions(-) (limited to 'pym/_emerge') 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 }, -- cgit v1.2.3-1-g7c22