depgraph: don't output \b to non-tty
authorZac Medico <zmedico@gentoo.org>
Wed, 2 Mar 2011 16:39:14 +0000 (08:39 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 2 Mar 2011 16:39:14 +0000 (08:39 -0800)
This will fix bug #357093.

pym/_emerge/depgraph.py

index b9c308bca4c8b75538a96ac9151bba208095eeb7..6de3d14301a2d7137a5209b1e2356efcc018e267 100644 (file)
@@ -5866,10 +5866,15 @@ def _spinner_start(spinner, myopts):
 
 def _spinner_stop(spinner):
        if spinner is None or \
-               spinner.update is spinner.update_quiet:
+               spinner.update == spinner.update_quiet:
                return
 
-       portage.writemsg_stdout("\b\b... done!\n")
+       if spinner.update != spinner.update_basic:
+               # update_basic is used for non-tty output,
+               # so don't output backspaces in that case.
+               portage.writemsg_stdout("\b\b")
+
+       portage.writemsg_stdout("... done!\n")
 
 def backtrack_depgraph(settings, trees, myopts, myparams, 
        myaction, myfiles, spinner):