.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Parse::DebianChangelog 3pm" .TH Parse::DebianChangelog 3pm "2018-10-29" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Parse::DebianChangelog \- parse Debian changelogs and output them in other formats .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Parse::DebianChangelog; \& \& my $chglog = Parse::DebianChangelog\->init( { infile => \*(Aqdebian/changelog\*(Aq, \& HTML => { outfile => \*(Aqchangelog.html\*(Aq } ); \& $chglog\->html; \& \& # the following is semantically equivalent \& my $chglog = Parse::DebianChangelog\->init(); \& $chglog\->parse( { infile => \*(Aqdebian/changelog\*(Aq } ); \& $chglog\->html( { outfile => \*(Aqchangelog.html\*(Aq } ); \& \& my $changes = $chglog\->dpkg_str( { since => \*(Aq1.0\-1\*(Aq } ); \& print $changes; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Parse::DebianChangelog parses Debian changelogs as described in the Debian policy (version 3.6.2.1 at the time of this writing). See section \&\*(L"\s-1SEE ALSO\*(R"\s0 for locations where to find this definition. .PP The parser tries to ignore most cruft like # or /* */ style comments, \&\s-1CVS\s0 comments, vim variables, emacs local variables and stuff from older changelogs with other formats at the end of the file. \&\s-1NOTE:\s0 most of these are ignored silently currently, there is no parser error issued for them. This should become configurable in the future. .PP Beside giving access to the details of the parsed file via the \&\*(L"data\*(R" method, Parse::DebianChangelog also supports converting these changelogs to various other formats. These are currently: .IP "dpkg" 4 .IX Item "dpkg" Format as known from \fIdpkg\-parsechangelog\fR\|(1). All requested entries (see \*(L"\s-1METHODS\*(R"\s0 for an explanation what this means) are returned in the usual Debian control format, merged in one stanza, ready to be used in a \fI.changes\fR file. .IP "rfc822" 4 .IX Item "rfc822" Similar to the \f(CW\*(C`dpkg\*(C'\fR format, but the requested entries are returned as one stanza each, i.e. they are not merged. This is probably the format to use if you want a machine-usable representation of the changelog. .IP "xml" 4 .IX Item "xml" Just a simple \s-1XML\s0 dump of the changelog data. Without any schema or \&\s-1DTD\s0 currently, just some made up \s-1XML.\s0 The actual format might still change. Comments and Improvements welcome. .IP "html" 4 .IX Item "html" The changelog is converted to a somewhat nice looking \s-1HTML\s0 file with some nice features as a quick-link bar with direct links to every entry. \&\s-1NOTE:\s0 This is not very configurable yet and was specifically designed to be used on . This is planned to be changed until version 1.0. .SS "\s-1METHODS\s0" .IX Subsection "METHODS" \fIinit\fR .IX Subsection "init" .PP Creates a new object instance. Takes a reference to a hash as optional argument, which is interpreted as configuration options. There are currently no supported general configuration options, but see the other methods for more specific configuration options which can also specified to \f(CW\*(C`init\*(C'\fR. .PP If \f(CW\*(C`infile\*(C'\fR, \f(CW\*(C`instring\*(C'\fR or \f(CW\*(C`handle\*(C'\fR are specified (see parse), \&\f(CW\*(C`parse()\*(C'\fR is called from \f(CW\*(C`init\*(C'\fR. If a fatal error is encountered during parsing (e.g. the file can't be opened), \f(CW\*(C`init\*(C'\fR will not return a valid object but \f(CW\*(C`undef\*(C'\fR! .PP \fIreset_parse_errors\fR .IX Subsection "reset_parse_errors" .PP Can be used to delete all information about errors ocurred during previous parse runs. Note that \f(CW\*(C`parse()\*(C'\fR also calls this method. .PP \fIget_parse_errors\fR .IX Subsection "get_parse_errors" .PP Returns all error messages from the last parse run. If called in scalar context returns a human readable string representation. If called in list context returns an array of arrays. Each of these arrays contains .IP "1." 4 the filename of the parsed file or \f(CW\*(C`String\*(C'\fR if a string was parsed directly .IP "2." 4 the line number where the error occurred .IP "3." 4 an error description .IP "4." 4 the original line .PP \&\s-1NOTE:\s0 This format isn't stable yet and may change in later versions of this module. .PP \fIget_error\fR .IX Subsection "get_error" .PP Get the last non-parser error (e.g. the file to parse couldn't be opened). .PP \fIparse\fR .IX Subsection "parse" .PP Parses either the file named in configuration item \f(CW\*(C`infile\*(C'\fR, the string saved in configuration item \f(CW\*(C`instring\*(C'\fR or the open file handle saved in the configuration item \f(CW\*(C`handle\*(C'\fR. In the latter case, the handle can be named by using the optional configuration item \f(CW\*(C`handlename\*(C'\fR. Accepts a hash ref as optional argument which can contain configuration items. .PP Returns \f(CW\*(C`undef\*(C'\fR in case of error (e.g. \*(L"file not found\*(R", \fBnot\fR parse errors) and the object if successful. If \f(CW\*(C`undef\*(C'\fR was returned, you can get the reason for the failure by calling the get_error method. .PP \fIdata\fR .IX Subsection "data" .PP \&\f(CW\*(C`data\*(C'\fR returns an array (if called in list context) or a reference to an array of Parse::DebianChangelog::Entry objects which each represent one entry of the changelog. .PP This is currently merely a placeholder to enable users to get to the raw data, expect changes to this \s-1API\s0 in the near future. .PP This method supports the common output options described in section \*(L"\s-1COMMON OUTPUT OPTIONS\*(R"\s0. .PP \fIdpkg\fR .IX Subsection "dpkg" .PP (and \fBdpkg_str\fR) .PP \&\f(CW\*(C`dpkg\*(C'\fR returns a hash (in list context) or a hash reference (in scalar context) where the keys are field names and the values are field values. The following fields are given: .IP "Source" 4 .IX Item "Source" package name (in the first entry) .IP "Version" 4 .IX Item "Version" packages' version (from first entry) .IP "Distribution" 4 .IX Item "Distribution" target distribution (from first entry) .IP "Urgency" 4 .IX Item "Urgency" urgency (highest of all printed entries) .IP "Maintainer" 4 .IX Item "Maintainer" person that created the (first) entry .IP "Timestamp" 4 .IX Item "Timestamp" date (see below) as a Unix timestamp .IP "Date" 4 .IX Item "Date" date of the (first) entry .IP "Closes" 4 .IX Item "Closes" bugs closed by the entry/entries, sorted by bug number .IP "Changes" 4 .IX Item "Changes" content of the the entry/entries .PP \&\f(CW\*(C`dpkg_str\*(C'\fR returns a stringified version of this hash which should look exactly like the output of \fIdpkg\-parsechangelog\fR\|(1). The fields are ordered like in the list above. .PP Both methods only support the common output options described in section \*(L"\s-1COMMON OUTPUT OPTIONS\*(R"\s0. .PP \fIdpkg_str\fR .IX Subsection "dpkg_str" .PP See dpkg. .PP \fIrfc822\fR .IX Subsection "rfc822" .PP (and \fBrfc822_str\fR) .PP \&\f(CW\*(C`rfc822\*(C'\fR returns an array of hashes (in list context) or a reference to this array (in scalar context) where each hash represents one entry in the changelog. For the format of such a hash see the description of the \*(L"dpkg\*(R" method (while ignoring the remarks about which values are taken from the first entry). .PP \&\f(CW\*(C`rfc822_str\*(C'\fR returns a stringified version of this hash which looks similar to the output of dpkg-parsechangelog but instead of one stanza the output contains one stanza for each entry. .PP Both methods only support the common output options described in section \*(L"\s-1COMMON OUTPUT OPTIONS\*(R"\s0. .PP \fIrfc822_str\fR .IX Subsection "rfc822_str" .PP See rfc822. .PP \fIxml\fR .IX Subsection "xml" .PP (and \fBxml_str\fR) .PP \&\f(CW\*(C`xml\*(C'\fR converts the changelog to some free-form (i.e. there is neither a \s-1DTD\s0 or a schema for it) \s-1XML.\s0 .PP The method \f(CW\*(C`xml_str\*(C'\fR is an alias for \f(CW\*(C`xml\*(C'\fR. .PP Both methods support the common output options described in section \*(L"\s-1COMMON OUTPUT OPTIONS\*(R"\s0 and additionally the following configuration options (as usual to give in a hash reference as parameter to the method call): .IP "outfile" 4 .IX Item "outfile" directly write the output to the file specified .PP \fIxml_str\fR .IX Subsection "xml_str" .PP See xml. .PP \fIhtml\fR .IX Subsection "html" .PP (and \fBhtml_str\fR) .PP \&\f(CW\*(C`html\*(C'\fR converts the changelog to a \s-1HTML\s0 file with some nice features such as a quick-link bar with direct links to every entry. The \s-1HTML\s0 is generated with the help of HTML::Template. If you want to change the output you should use the default template provided with this module as a base and read the documentation of HTML::Template to understand how to edit it. .PP The method \f(CW\*(C`html_str\*(C'\fR is an alias for \f(CW\*(C`html\*(C'\fR. .PP Both methods support the common output options described in section \*(L"\s-1COMMON OUTPUT OPTIONS\*(R"\s0 and additionally the following configuration options (as usual to give in a hash reference as parameter to the method call): .IP "outfile" 4 .IX Item "outfile" directly write the output to the file specified .IP "template" 4 .IX Item "template" template file to use, defaults to tmpl/default.tmpl, so you most likely want to override that. \&\s-1NOTE:\s0 The plan is to provide a configuration file for the module later to be able to use sane defaults here. .IP "style" 4 .IX Item "style" path to the \s-1CSS\s0 stylesheet to use (a default might be specified in the template and will be honoured, see the default template for an example) .IP "print_style" 4 .IX Item "print_style" path to the \s-1CSS\s0 stylesheet to use for printing (see the notes for \&\f(CW\*(C`style\*(C'\fR about default values) .PP \fIhtml_str\fR .IX Subsection "html_str" .PP See html. .PP \fIinit_filters\fR .IX Subsection "init_filters" .PP not yet documented .PP \fIapply_filters\fR .IX Subsection "apply_filters" .PP not yet documented .PP \fIadd_filter, delete_filter, replace_filter\fR .IX Subsection "add_filter, delete_filter, replace_filter" .PP not yet documented .SH "COMMON OUTPUT OPTIONS" .IX Header "COMMON OUTPUT OPTIONS" The following options are supported by all output methods, all take a version number as value: .IP "since" 4 .IX Item "since" Causes changelog information from all versions strictly later than \fBversion\fR to be used. .Sp (works exactly like the \f(CW\*(C`\-v\*(C'\fR option of dpkg-parsechangelog). .IP "until" 4 .IX Item "until" Causes changelog information from all versions strictly earlier than \fBversion\fR to be used. .IP "from" 4 .IX Item "from" Similar to \f(CW\*(C`since\*(C'\fR but also includes the information for the specified \fBversion\fR itself. .IP "to" 4 .IX Item "to" Similar to \f(CW\*(C`until\*(C'\fR but also includes the information for the specified \fBversion\fR itself. .PP The following options also supported by all output methods but don't take version numbers as values: .IP "all" 4 .IX Item "all" If set to a true value, all entries of the changelog are returned, this overrides all other options. While the \s-1XML\s0 and \s-1HTML\s0 formats default to all == true, this does of course not overwrite other options unless it is set explicitly with the call. .IP "count" 4 .IX Item "count" Expects a signed integer as value. Returns \f(CW\*(C`value\*(C'\fR entries from the top of the changelog if set to a positive integer, and \f(CW\*(C`abs(value)\*(C'\fR entries from the tail if set to a negative integer. .IP "offset" 4 .IX Item "offset" Expects a signed integer as value. Changes the starting point for \&\f(CW\*(C`count\*(C'\fR, either counted from the top (positive integer) or from the tail (negative integer). \f(CW\*(C`offset\*(C'\fR has no effect if \f(CW\*(C`count\*(C'\fR wasn't given as well. .PP Some examples for the above options. Imagine an example changelog with entries for the versions 1.2, 1.3, 2.0, 2.1, 2.2, 3.0 and 3.1. .PP .Vb 10 \& Call Included entries \& format({ since => \*(Aq2.0\*(Aq }) 3.1, 3.0, 2.2 \& format({ until => \*(Aq2.0\*(Aq }) 1.3, 1.2 \& format({ from => \*(Aq2.0\*(Aq }) 3.1, 3.0, 2.2, 2.1, 2.0 \& format({ to => \*(Aq2.0\*(Aq }) 2.0, 1.3, 1.2 \& format({ count => 2 } 3.1, 3.0 \& format({ count => \-2 } 1.3, 1.2 \& format({ count => 3, \& offset => 2 } 2.2, 2.1, 2.0 \& format({ count => 2, \& offset => \-3 } 2.0, 1.3 \& format({ count => \-2, \& offset => 3 } 3.0, 2.2 \& format({ count => \-2, \& offset => \-3 } 2.2, 2.1 .Ve .PP Any combination of one option of \f(CW\*(C`since\*(C'\fR and \f(CW\*(C`from\*(C'\fR and one of \&\f(CW\*(C`until\*(C'\fR and \f(CW\*(C`to\*(C'\fR returns the intersection of the two results with only one of the options specified. .SH "SEE ALSO" .IX Header "SEE ALSO" Parse::DebianChangelog::Entry, Parse::DebianChangelog::ChangesFilters .PP Description of the Debian changelog format in the Debian policy: . .SH "AUTHOR" .IX Header "AUTHOR" Frank Lichtenheld, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2005 by Frank Lichtenheld .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \&\s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, \s-1MA\s0 02110\-1301 \s-1USA\s0