16 Apr 2005 06:13
Is there an easy way to get a simple dict of rpm attributes from xml metadata?
Brad Smith <brads <at> redhat.com>
2005-04-16 04:13:29 GMT
2005-04-16 04:13:29 GMT
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(Continue reading)
RSS Feed