Is there an easy way to get a simple dict of rpm attributes from xml metadata?

Brad Smith <[email protected]>
Newsgroups gmane.linux.rpm.metadata
Organization Red Hat
Message-ID <[email protected]>
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

_______________________________________________
Rpm-metadata mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBCYJDpDvp49DvQ8kcRArMPAJ9zEb6RE6699v2Iy4XmzesRSdTR8QCfbBhW
Mjniot+UcAuOgUQ7SDgibMc=
=FxGx
-----END PGP SIGNATURE-----
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.