Re: Accessing changelog info
Paul Nasrat <pauln-xGvoirzvwgBWk0Htik3J/[email protected]> Mon, 26 Jul 2004 07:39:21 +0000
| Newsgroups | gmane.linux.redhat.rpm.python |
|---|---|
| Message-ID | <[email protected]> |
On Sun, Jul 25, 2004 at 08:24:55PM -0400, Brad Smith wrote: > On Sun, 2004-07-25 at 18:04, Alan Sparks wrote: > > Can someone provide a reference how to access the "changelog" > > information using the rpm module? I see that accessing the header > > CHANGELOGTEXT, CHANGELOGNAME, etc attributes return lists of data, but I > > cannot see how to correlate the text/name/date lists. > > > > Thanks for any pointers. > > > Unless I'm mistaken it should be as simple as: > > changelogtime[X] + changelogname[X] + changelogtext[X] = Line X of the > changelog. > > > Below I've cut-and-pasted a snippet from Fedora Tracker (starting at > line 352 of repo.py), which stores each package's changelog as a single > string. There is one gotcha to this, described in the comments. > > P.S. I'm not a python or rpm guru, so if I'm doing anything stupid here, > let me know. =;) To get the changelog as a list of tuples you could do: zip(h["changelogtime"], h["changelogname"], h["changelogtext"]) > # I've seen yum headers where changelogs with a single entry > have the timestamp (but not the other stuff) Hmm, do you have any package examples you could point me at. Paul