[Yum] Scripting Yum
Michael Stenner
mstenner at ece.arizona.edu
Thu Aug 4 21:24:59 UTC 2005
OK. I'm replying here with my two cents. I don't want to jump in the
middle of that mess. At some level, you can break down all program
communication to exchange of data. Passing it over a pipe is simply
the medium. MY PERSONAL definition of screen-scraping is:
automated parsing of data that was only every intended for human
consumption
Examples of screen scraping:
parsing slashdot's web page
parsing auction-ended emails from ebay
parsing the terminal-output from yum
Not screen-scraping:
rpm -qa | grep ...
parsing slashdot's rss feed
using the yum modules
The point is that yum's output was designed for humans, not machines.
As such, it may not be suitable for machines. For example, at times
long package names have been trimmed to fit in 80 colums.
It's really really easy to make changes that humans never notice (or
like better) that completely break machines. It's nice to have that
flexibility in yum. If you parse the yum output directly, then EITHER
it's prone to breaking badly when the output format changes OR the
output format should remain fixed, or at the very least any changes
must be considered carefully.
That's the bottom line: rpm -qa is MEANT to be processed by machines.
Yum's output isn't.
I'm as much of a python fan as Seth, but (at least for me) that has
NOTHING to do with this. I'm a big fan of the unix philosophy, too.
I'm on board. Really, I am, but the yum output cannot be reliably
parsed because it's not written to be.
-Michael
--
Michael D. Stenner mstenner at ece.arizona.edu
ECE Department, the University of Arizona 520-626-1619
1230 E. Speedway Blvd., Tucson, AZ 85721-0104 ECE 524G
More information about the Yum
mailing list