On Sat, 2008-01-26 at 13:18 +0200, Panu Matilainen wrote:
> Yup... Where you will get into trouble is checksumming, taking prelinking 
> into account and that fun, if there are other special cases I don't recall 
> offhand. Rpmlib knows how to deal with those, and the responsibility of 
> fetching the on-disk info should be rpmlib's, not each and every API 
> users'.
> 
> I've been thinking about the "verify API" on and off, what I have in mind 
> at the moment is a (rpmfi) method that'll give you a new rpmfi object, 
> populated with the on-disk information. With that, all you have to do is 
> to iterate over the header-fi and ondisk-fi objects and compare the data.
> So verifying a package would look somewhat like this:
> 
> fi = hdr.fiFromHeader()
> dfi = fi.onDisk(patterns=[])
> while ... iterate over both rpmfi objects...:
>      if fi.group != dfi.group:
>          problems.append("group mismatch")
>      if fi.mtime != dfi.mtime:
>          problems.append("mtime mismatch")
>      ...
> 
> This would (should ;) work on both C and Python level pretty much "just 
> like that", without requiring any new data structures and methods to 
> access the data. rpmlib already knows how to fetch all the ondisk info 
> naturally, it just throws away the actual data and gives "modified" vs 
> "not modified" answers. All that's needed is the rpmfiFromDisk() 
> method (on C-level), should be fairly straightforward to lift the existing 
> verification code and stuff it into rpmfi...
> 
> There you'd have a very simple to use lowlevel "verification API", on top 
> of which you can then build whatever fancy python verification objects if 
> you wish.
> 
> Thoughts?

The above makes a lot of sense to me. Especially since a number of the
fields in the rpmfi tuple are, umm, not obvious to discern. Doing a
simple comparison would be great. Thanks.

 Though, if you really want to make me happy by working on some of the
python bindings I have a hankering for rpmbuild. :)

-sv


_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to