Programmatic interface to yum configuration files?

"Amos Shapira" <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
Hello,

My environment: CentOS 5.2, rpmforge repo

Is there some scriptable way to manipulate the yum configuration files?

Examples of things I'd like to be able to do automatically (e.g. from
inside an automatic deployment process):

1. Add "priority=" (with different values) to each repository.
2. Add "check_obsoletes=1" to priorities plugin
3. Add proxy settings

So far I made-do with specific hacks of perl/sed (e.g. "sed -i~
'/^\[main\]/a proxy=http://10.10.1.65:3128' /etc/yum.conf") but as I'd
like to generalise the approach I think it would be better to have
something which really understands the config file.

Perl is my favourite tool. I realise the Yum is written or heavily
uses Python so I suppose I'll manage with python scripts which can be
controlled from perl.

Thanks,

--Amos
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.