Re: RPM Objects 0.1
seth vidal <skvidal-c/MNwgJ9CEH2fBVCVOL8/[email protected]> Thu, 25 Mar 2004 23:41:00 -0500
| Newsgroups | gmane.linux.redhat.rpm.python |
|---|---|
| Message-ID | <1080276059.23184.30.camel@binkley> |
On Thu, 2004-03-25 at 17:47 -0500, Adam T. Gautier wrote: > Here is the 0.1 release of RPM Objects. This provides basic support for > install, upgrades, query, and uninstall. The basic object provided are: > > Callback - Basic callback object the may and should be sublassed. > Package - Basic rpm package definition. Genrerally what is returned > when interfacing with the Database object > File - Subclass of Package and adds file I/O to Package. This is > obviously used interface with rpm files and what is provided to install > packages > Transaction - Wrapper for the txn id... Still very raw > Database - Main wrapper for interactation with rpmdb, transaction > support lacking as well as flags and probe filters (look at the todo.txt) > > The test.py shows some of the features but needs to be refined. I want > to develop several simple rpm files for the test harness. Check out the > todo.txt for a better idea where I am taking this. A few comments from a kinda casual browse: in RPM/database.commit() you do: self.ts.check() self.ts.order() errors = self.ts.run(...) check() and order() don't raise exceptions they return errors - so since you're not checking them I'm kinda lost as to what, other than ordering, it's doing there. I presume just ordering, but it might be useful to have a way to know that the ts passed a check before you continue. in package.py you're referring to REQUIRES and PROVIDES - you might be better off looking at some other tags and combining them: There are 4 categories of data in a header that are all obtained the same way: requires, provides, conflicts, obsoletes you can get all the data about them via: RPMTAG_REQUIRENAME RPMTAG_REQUIREFLAGS RPMTAG_REQUIREVERSION replace REQUIRE in the above with: PROVIDE, CONFLICT or OBSOLETE if you want look here: http://devel.linux.duke.edu/cgi-bin/viewcvs.cgi/generate/dumpMetadata.py?rev=1.10&cvsroot=metadata&content-type=text/vnd.viewcvs-markup in the simple RpmMetaData class it was just written to pull the data out for the xml metadata but it's not too bad to go through. -sv