On Dec 4, 2010, at 8:47 PM, Per Øyvind Karlsen wrote: > > > Quick code sample provided would be greatly appreciated, I've been trying to > look at code in rpm, but somehow my attempts to achieve the same fails.. >
Well the quickest code sample is to look at lib/rpminstall.c, which uses rpmgi to iterate over an argv list, including inserting manifests into the argv list as encountered. Headers (needed to add to transactions) are performed as a method on the rpmgi object. The basic model is/was the same as an rpmmi, and an rpmmi retrieval from an rpmdb is another mode of operation for an rpmgi. Finally hdlists are just another sequence of headers, just like an iteration over argv *.rpm or an iterator over an rpmdb. Note the code in lib/query.c should allow queries onto hdlists. There's some limitations, such as a compiled in path to the location where anaconda used to store hdlists that I've never bothered to turn into a macro because there literally hasn't been any interest. Do you have a hdlist that I can use? If you can give ma a pointer, I can rapidly write up specific usage details, and suggest what might be done through URPM.xs. Caveat: The rpmgi iteration over hdllists hasn't been looked at in years. But its utterly easy to read concatenated headers from a single open FD_t, which is all that rpmgi has ever done. hth 73 de jeff ______________________________________________________________________ RPM Package Manager http://rpm5.org Developer Communication List rpm-devel@rpm5.org