[Yum] Scripting Yum

Simon Perreault nomis80 at lqt.ca
Thu Aug 4 19:16:13 UTC 2005


On Thursday 04 August 2005 15:02, seth vidal wrote:
> You'd be doing work that is extremely unlikely to be included in yum if
> you do that. I've been discouraging screen scraping for a while now b/c
> it is error-prone and ridiculous when yum has modules intended for use
> in other scripts.

Yes, I too am against screen-scraping. However, UNIX-like interoperability is 
not screen scraping. Is this screen-scraping?

rpm -qa | grep ^perl- | xargs rpm -ql | xargs grep -l ^#!/usr/bin/perl | xargs 
perl -c

Of course not. It is an example of the ease with which UNIX tools can be 
combined. It's not guaranteed to be right, but most of the time it is and the 
fact that it's a single line is a major advantage.

If there existed a way for yum to provide simple output, separated by 
newlines, so that it could be scripted in UNIX fashion then no doubt that 
would be great.

> What's wrong with writing a python script that does:
> import yum

You have to write Python.

Taking your argument further, you could say that scriptability is not useful 
because you can write C that would do the same thing.



More information about the Yum mailing list