kickstart vs. yum
Bryan Smith
bjs at redhat.com
Sat Feb 11 21:35:00 UTC 2012
Understood. I was referring more to piping the information out as you desire, hence the "P.S." (and not really part of my response). But thank you for pointing out one should script around repoquery instead of yum, and that was an oversight on my part.
I also noted the comps.xml file in my "P.S.," which I've written Perl around in the past. I've also done some custom Anaconda Python modification, but that was years ago (FC6/RHEL5 timeframe, long story, you might remember some of it). I guess I was referring more to modifying the comps.xml file directly, to add new groups. Is there a better method via the Python API to do such? Or is it okay (or even best) to do it off-line, on the comps.xml file directly?
----- Original Message -----
From: "seth vidal" <skvidal at fedoraproject.org>
Sent: Saturday, February 11, 2012 12:31:08 PM
Hi Bryan,
yum's cli is not intended to be scripted. Don't recommend that to
others.
If you want to script to yum you should use either of the following:
- repoquery
- yum's python api
The yum python interface for working with the comps file is actually
pretty straightforward
as an example
#!/usr/bin/python
import yum
my = yum.YumBase()
my.setCacheDir()
for g in my.comps.groups:
print g.groupid
core = my.comps.return_group('core')
for pkg in core.packages:
print pkg
lots to explore in there - I recommend using ipython to help you
explore the interface.
More information about the Kickstart-list
mailing list