Re: Accessing changelog info

Alan Sparks <[email protected]> 26 Jul 2004 10:05:52 -0600
Newsgroups gmane.linux.redhat.rpm.python
Message-ID <1090857952.30500.0.camel@asparks>
Thanks, guys.  This was just what I needed.
-Alan

On Mon, 2004-07-26 at 01:39, Paul Nasrat wrote:
> 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
> _______________________________________________
> Rpm-python-list mailing list
> Rpm-python-list-cunTk1MwBs9zPNxIf5reH/[email protected]
> https://lists.dulug.duke.edu/mailman/listinfo/rpm-python-list
-- 
Alan Sparks, Sr. UNIX Administrator	[email protected]
Quris, Inc.				(720) 836-2058