From 7c63db682b14b0f45a2ce79a7db36534545ba85c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 9 Jul 2007 10:10:20 +0000 Subject: Fix interaction of resume opts with spinner output handling so that output always looks correct. svn path=/main/trunk/; revision=7207 --- pym/emerge/__init__.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index aa69b0da2..6395b0d5c 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -3279,11 +3279,6 @@ class depgraph(object): Add a resume command to the graph and validate it in the process. This will raise a PackageNotFound exception if a package is not available. """ - # "myopts" is a list for backward compatibility. - resume_opts = dict((k,True) for k in resume_data["myopts"]) - for opt in ("--skipfirst", "--ask", "--tree"): - resume_opts.pop(opt, None) - self.myopts.update(resume_opts) self._sets["args"].update(resume_data.get("favorites", [])) mergelist = resume_data.get("mergelist", []) fakedb = self.mydbapi @@ -5445,15 +5440,25 @@ def action_build(settings, trees, mtimedb, mysettings.lock() del myroot, mysettings - myparams = create_depgraph_params(myopts, myaction) - if "--quiet" not in myopts and "--nodeps" not in myopts: + # "myopts" is a list for backward compatibility. + resume_opts = mtimedb["resume"].get("myopts", []) + if isinstance(resume_opts, list): + resume_opts = dict((k,True) for k in resume_opts) + for opt in ("--skipfirst", "--ask", "--tree"): + resume_opts.pop(opt, None) + myopts.update(resume_opts) + show_spinner = "--quiet" not in myopts and "--nodeps" not in myopts + if not show_spinner: + spinner.update = spinner.update_quiet + if show_spinner: print "Calculating dependencies ", + myparams = create_depgraph_params(myopts, myaction) mydepgraph = depgraph(settings, trees, myopts, myparams, spinner) try: mydepgraph.loadResumeCommand(mtimedb["resume"]) except portage.exception.PackageNotFound: - if "--quiet" not in myopts: + if show_spinner: print from portage.output import EOutput out = EOutput() @@ -5461,7 +5466,7 @@ def action_build(settings, trees, mtimedb, out.eerror(" available to be emerged. Please restart/continue") out.eerror(" the merge operation manually.") return 1 - if "--quiet" not in myopts and "--nodeps" not in myopts: + if show_spinner: print "\b\b... done!" else: if ("--resume" in myopts): -- cgit v1.2.3-1-g7c22