Place Ghantoos

YUM output parser (yum-parser.py)

As I needed to minimize yum’s output for a project I was working on, I thought it was just about changing the debugging level. But I found out yum’s debugging level could add information, but not minimize it. So wrote a small python script that does the job.

What I wanted to do, is replace yum’s output with a very simple progress bar showing only the different stages of a yum procedure (dependencies/download/install/remove/update).

The script is quite easy to use:

Usage:
	$ yum-parser.py (-u | --update)
	$ yum-parser.py (-i | --install) package_list
	$ yum-parser.py (-r | --remove) package_list
	$ yum-parser.py (-s | --search) 'regexp'
	$ yum-parser.py (-h | --help) package_list

For a reason I still ignore, when redirecting yum’s generic output to a file (e.g. yum -y install irssi 2>&1 > yumoutput), the “Downloading Packages” part doesn’t appear. To remedy this problem, I had to insert some threading to have a “patience bar” (i.e. back and forth [ = ]) while the downloads are processed.

You can find the source code here.

Read the rest of this entry »