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>
Mon, 14 Mar 2011 16:03:03 +0000 (09:03 -0700)
This will fix bug #357093.

pym/_emerge/depgraph.py

index a755116ce3879619f1a65dc2c84af2f00a88309a..f17a93ccbd0045a407a1b4e02e2120dab7a490af 100644 (file)
@@ -5772,10 +5772,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):