On Mon, 30 Mar 2009, Stephen Childs wrote:
Hi,
We have our own packager as part of the quattor toolkit (http://quattor.org).
Basically it ensures that all the packages in a defined list are installed on
a machine (it has no dependency checking). We would like to do some
dependency checking on the list of packages before deploying to machines.
This is an ideal job for YUM.
Basically I would like to be able to pass a transaction set into YUM and get
back a list of the extra packages that need to be added to resolve
dependencies.
Currently I am doing this by setting up a transaction set, then calling YUM's
resolveDeps function, and scanning YUM's log for statements like this
(generated by YUM's _requiringFromTransaction function):
TSINFO: Marking gjdoc-0.7.7-12.el5.x86_64 as install for
java-1.4.2-gcj-compat-1.4.2.0-40jpp.112.x86_64
and parsing it to generate the output at the end of this email. Obviously
this is fragile and messy.
Is there any clean way of retrieving this information from YUM? If not, do
what would be the best way of adding this functionality to YUM?
Set up a transaction set. Then call resolveDeps. Then do:
for txmbr in YumBaseObject.tsInfo.getMembers():
if txmbr.name not in my_list_of_pkgs_I_have:
my_list_of_pkgs_I_have.append(txmbr)
or something along those lines.
that way you don't have to scan logs - you just pull it directly from the
Transaction Info.
you might also consider looking at the repoclosure yum util.
-sv
_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel