diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-23 06:28:06 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-23 06:28:06 +0000 |
commit | db85f2b81ef607357fe2eaa8719192a2edd62e77 (patch) | |
tree | 31cfcf28b19f79d7c5c0321cb34f2ec0a4d8af66 /pym/_emerge/actions.py | |
parent | 351ae4f408f327def14b13c653a82a5e96278ee0 (diff) | |
download | portage-db85f2b81ef607357fe2eaa8719192a2edd62e77.tar.gz portage-db85f2b81ef607357fe2eaa8719192a2edd62e77.tar.bz2 portage-db85f2b81ef607357fe2eaa8719192a2edd62e77.zip |
Factor out duplicate "These are the packages that would be merged",
"Calculating dependencies", and spinner cleanup code.
svn path=/main/trunk/; revision=14704
Diffstat (limited to 'pym/_emerge/actions.py')
-rw-r--r-- | pym/_emerge/actions.py | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index ea7f241a8..916d6a8ba 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -165,42 +165,10 @@ def action_build(settings, trees, mtimedb, writemsg("%s%s\n" % (prefix, line)) writemsg(prefix + "\n") - if "--quiet" not in myopts and \ - ("--pretend" in myopts or "--ask" in myopts or \ - "--tree" in myopts or "--verbose" in myopts): - action = "" - if "--fetchonly" in myopts or "--fetch-all-uri" in myopts: - action = "fetched" - elif "--buildpkgonly" in myopts: - action = "built" - else: - action = "merged" - if "--tree" in myopts and action != "fetched": # Tree doesn't work with fetching - if "--unordered-display" in myopts: - portage.writemsg_stdout("\n" + \ - darkgreen("These are the packages that " + \ - "would be %s:" % action) + "\n\n") - else: - portage.writemsg_stdout("\n" + \ - darkgreen("These are the packages that " + \ - "would be %s, in reverse order:" % action) + "\n\n") - print() - else: - print() - print(darkgreen("These are the packages that would be %s, in order:") % action) - print() - - show_spinner = "--quiet" not in myopts and "--nodeps" not in myopts - if not show_spinner: - spinner.update = spinner.update_quiet - if resume: favorites = mtimedb["resume"].get("favorites") if not isinstance(favorites, list): favorites = [] - - if show_spinner: - print("Calculating dependencies ", end=' ') myparams = create_depgraph_params(myopts, myaction) resume_data = mtimedb["resume"] @@ -221,8 +189,7 @@ def action_build(settings, trees, mtimedb, depgraph.UnsatisfiedResumeDep) as e: if isinstance(e, depgraph.UnsatisfiedResumeDep): mydepgraph = e.depgraph - if show_spinner: - print() + from textwrap import wrap from portage.output import EOutput out = EOutput() @@ -274,9 +241,6 @@ def action_build(settings, trees, mtimedb, "the operation manually." for line in wrap(msg, 72): out.eerror(line) - else: - if show_spinner: - print("\b\b... done!") if success: if dropped_tasks: @@ -304,24 +268,15 @@ def action_build(settings, trees, mtimedb, print(darkgreen("emerge: It seems we have nothing to resume...")) return os.EX_OK - if "--quiet" not in myopts and "--nodeps" not in myopts: - print("Calculating dependencies ", end=' ') - sys.stdout.flush() - myparams = create_depgraph_params(myopts, myaction) try: success, mydepgraph, favorites = backtrack_depgraph( settings, trees, myopts, myparams, myaction, myfiles, spinner) except portage.exception.PackageSetNotFound as e: - if show_spinner: - print("\b\b... done!") root_config = trees[settings["ROOT"]]["root_config"] display_missing_pkg_set(root_config, e.value) return 1 - if show_spinner: - print("\b\b... done!") - if not success: mydepgraph.display_problems() return 1 |