[Yum] Regarding yum download progress information

Zdenek Pavlas zpavlas at redhat.com
Mon Nov 28 14:44:18 UTC 2011


> I'd like to get the current percentage download done information in
> some way or the other when yum is downloading to stdout or a file.
..
> Is it possible?

'yum' and 'yumdownloader' do not print progress information unless
the output is a tty, as it's not meant to be parsed.  AFAIK there's
no easy way to access the progress if stdout is redirected.

With '-d[01]' we don't report progress even on a tty.. 
Maybe we should turn the progress report on with '-d9'?

diff --git a/output.py b/output.py
index be4e4d9..991b337 100755
--- a/output.py
+++ b/output.py
@@ -1558,7 +1558,7 @@ Transaction Summary
         # if we're below 2 on the debug level we don't need to be outputting
         # progress bars - this is hacky - I'm open to other options
         # One of these is a download
-        if self.conf.debuglevel < 2 or not sys.stdout.isatty():
+        if self.conf.debuglevel < 2 or not (sys.stdout.isatty() or self.conf.debuglevel == 9):
             progressbar = None
             callback = None
         else:


More information about the Yum mailing list