[Yum] Scripting Yum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2005-08-04 at 14:37 -0400, Simon Perreault wrote:
> Hello,
> 
> I've been trying to drive yum from a script. I've realized that yum (the 
> command) is really a command-line GUI, not designed for being scripted the 
> UNIX way.
> 
> For example: I wanted to get the names of packages available for update. Easy, 
> I thought, I'll just parse the output of "yum list updates". But there is a 
> problem with packages whose name is longer than the width of the column for 
> names. Some packages' name ends "under" the version column. So, what are my 
> options?
> 
> I'd rather not have to hack a Python wrapper around the Yum libraries to 
> provide a scriptable interface. Instead, I would like to hack yum itself so 
> that it presents a scriptable interface when a given command-line option (how 
> about --scriptable?) is used.
> 
> How about that? Is that a good idea? Am I reinventing the foot or even (gasp!) 
> shooting myself in the wheel?

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.

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

and does the rest from there?

-sv



[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux