[Rpm-metadata] Is there an easy way to get a simple dict of rpm attributes from xml metadata?
Brad Smith
brads at redhat.com
Sat Apr 16 04:13:29 UTC 2005
Hello everyone,
I'm currently working to add support for xml metadata into Fedora
Tracker, but am at a point where I'd like some advice:
The plan was to have the tracker's back-end script download the xml
files for a repository, then use code from Seth's importmetadata.py
(http://www.linux.duke.edu/~skvidal/metadata/) to load up a packageSack
with all of the metadata in it. I could convert each set of rpm data in
the sack into an instace of tracker's internal repo.rpmInfo class, since
I already have code to handle putting those into the database.
However, in examining packageSack.py, It appears that a lot of
information that tracker stores is not kept when a
packageObject.RpmXMLPackageObject instance is added to the sack. For
example, packageSack.addPackage() does not appear to store the
description field or any of the scripts, all of which Tracker would
need.
So now I'm thinking that maybe the best approach would be to either
derive a new class from packageSack and override addPackage() with a
method that converts directly to repo.rpmInfo instances or just yank the
code for addPackage() and load*MD() from RpmXMLPackageObject into a new
class, since those three methods are really all I need for my purposes
(I think).
Does anyone have suggestions for an alternative that I may be missing?
All I know about what tools have already been written is what I've
gleaned from the code I can find, so maybe there's something more suited
to my purposes. Something that takes an xml file and returns a dict akin
to what rpm.headerLoad() returns would be ideal. Does such a thing
already exist?
Thanks, and sorry if any of this sounds dumb. =;)
--Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/rpm-metadata/attachments/20050415/e54eac99/attachment.pgp
More information about the Rpm-metadata
mailing list