dpkg (1.18.25) stretch; urgency=medium
[dpkg] / man / dpkg-parsechangelog.man
CommitLineData
1479465f
GJ
1.\" dpkg manual page - dpkg-parsechangelog(1)
2.\"
3.\" Copyright © 1995-1996 Ian Jackson <ijackson@chiark.greenend.org.uk>
4.\" Copyright © 2000 Wichert Akkerman <wakkerma@debian.org>
5.\" Copyright © 2006, 2011-2015 Guillem Jover <guillem@debian.org>
6.\" Copyright © 2007-2008 Frank Lichtenheld <djpig@debian.org>
7.\" Copyright © 2009 Raphaël Hertzog <hertzog@debian.org>
8.\"
9.\" This is free software; you can redistribute it and/or modify
10.\" it under the terms of the GNU General Public License as published by
11.\" the Free Software Foundation; either version 2 of the License, or
12.\" (at your option) any later version.
13.\"
14.\" This is distributed in the hope that it will be useful,
15.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.\" GNU General Public License for more details.
18.\"
19.\" You should have received a copy of the GNU General Public License
20.\" along with this program. If not, see <https://www.gnu.org/licenses/>.
21.
22.TH dpkg\-parsechangelog 1 "%RELEASE_DATE%" "%VERSION%" "dpkg suite"
23.nh
24.SH NAME
25dpkg\-parsechangelog \- parse Debian changelog files
26.
27.SH SYNOPSIS
28.B dpkg\-parsechangelog
29.RI [ option ...]
30.
31.SH DESCRIPTION
32.B dpkg\-parsechangelog
33reads and parses the changelog of an unpacked Debian source tree and
34outputs the information in it to standard output in a machine-readable
35form.
36.
37.SH OPTIONS
38.TP
39.BR \-l ", " \-\-file " \fIchangelog-file\fP"
40Specifies the changelog file to read information from.
41A ‘\-’ can be used to specify reading from standard input.
42The default is
43.BR debian/changelog .
44.TP
45.BR \-F " \fIchangelog-format\fP"
46Specifies the format of the changelog. By default the format is read
47from a special line near the bottom of the changelog or failing that
48defaults to the \fBdebian\fP standard format. See also
49\fBCHANGELOG FORMATS\fP.
50.TP
51.BR \-L " \fIlibdir\fP"
52Obsolete option without effect (since dpkg 1.18.8).
53Setting the perl environment variables \fBPERL5LIB\fP or \fBPERLLIB\fP
54has a similar effect when looking for the parser perl modules.
55.TP
56.BR \-S ", " \-\-show\-field " \fIfield\fP"
57Specifies the name of the field to show (since dpkg 1.17.0).
58The field name is not printed, only its value.
59.TP
60.BR \-? ", " \-\-help
61Show the usage message and exit.
62.TP
63.BR \-\-version
64Show the version and exit.
65.SS Parser Options
66The following options can be used to influence the output of
67the changelog parser, e.g. the range of entries or the format
68of the output.
69.TP
70.BI \-\-format " output-format"
71Set the output format. Currently supported values are
72.BR dpkg " and " rfc822 .
73\fBdpkg\fP is the classic output format (from before this
74option existed) and the default. It consists of one paragraph
75in Debian control format (see \fBdeb\-control\fP(5)). If more
76than one entry is requested, then most fields are taken from the
77most recent entry, except otherwise stated:
78.RS
79.TP
80.BI Source: " pkg-name"
81.TP
82.BI Version: " version"
83.TP
84.BI Distribution: " target-distribution"
85.TP
86.BI Urgency: " urgency"
87The highest urgency of all included entries is used, followed by the
88concatenated (space-separated) comments from all the versions requested.
89.TP
90.BI Maintainer: " author"
91.TP
92.BI Date: " date"
93The date of the entry as a string, as it appears in the changelog.
94With a \fBstrptime\fP(3) format "\fB%a, %d %b %Y %T %z\fP", but where the
95day of the week might not actually correspond to the real day obtained
96from the rest of the date string.
97If you need a more accurate representation of the date, use the
98\fBTimestamp\fP field, but take into account it might not be possible to
99map it back to the exact value in this field.
100.TP
101.BI Timestamp: " timestamp"
102The date of the entry as a timestamp in seconds since the epoch
103(since dpkg 1.18.8).
104.TP
105.BI Closes: " bug-number"
106The Closes fields of all included entries are merged.
107.TP
108.BI Changes: " changelog-entries"
109The text of all changelog entries is concatenated. To make
110this field a valid Debian control format multiline field
111empty lines are replaced with a single full stop and all lines
112is intended by one space character. The exact content depends
113on the changelog format.
114.RE
115.IP
116The \fBVersion\fP, \fBDistribution\fP, \fBUrgency\fP, \fBMaintainer\fP and
117\fBChanges\fP fields are mandatory.
118.IP
119There might be additional user-defined fields present.
120.IP
121The \fBrfc822\fP format uses the same fields but outputs
122a separate paragraph for each changelog entry so that all
123metadata for each entry is preserved.
124.TP
125.B \-\-all
126Include all changes. Note: other options have no effect when this is in use.
127.TP
128.BR \-s ", " \-\-since " \fIversion\fP"
129.TQ
130.BR \-v " \fIversion\fP"
131Include all changes later than \fIversion\fP.
132.TP
133.BR \-u ", " \-\-until " \fIversion\fP"
134Include all changes earlier than \fIversion\fP.
135.TP
136.BR \-f ", " \-\-from " \fIversion\fP"
137Include all changes equal or later than \fIversion\fP.
138.TP
139.BR \-t ", " \-\-to " \fIversion\fP"
140Include all changes up to or equal than \fIversion\fP.
141.TP
142.BR \-c ", " \-\-count " \fInumber\fP"
143.TQ
144.BR \-n " \fInumber\fP"
145Include \fInumber\fP entries from the top (or the tail
146if \fInumber\fP is lower than 0).
147.TP
148.BR \-o ", " \-\-offset " \fInumber\fP"
149Change the starting point for \fB\-\-count\fP, counted from the top
150(or the tail if \fInumber\fP is lower than 0).
151.
152.SH CHANGELOG FORMATS
153It is possible to use a different format to the standard one, by providing
154a parser for that alternative format.
155
156In order to have \fBdpkg\-parsechangelog\fP run the new parser, a line must
157be included within the last 40 lines of the changelog file, matching the Perl
158regular expression: “\fB\\schangelog-format:\\s+([0-9a-z]+)\\W\fP”.
159The part in parentheses should be the name of the format. For example:
160
161 @@@ changelog-format: \fIotherformat\fP @@@
162
163Changelog format names are non-empty strings of alphanumerics.
164
165If such a line exists then \fBdpkg\-parsechangelog\fP will look for
166the parser as a \fBDpkg::Changelog::\fP\fIOtherformat\fP perl module;
167it is an error for it not being present.
168The parser name in the perl module will be automatically capitalized.
169The default changelog format is \fBdebian\fP, and a parser for it is
170provided by default.
171
172The parser should be derived from the Dpkg::Changelog class and implement
173the required documented interface.
174
175If the changelog format which is being parsed always or almost always
176leaves a blank line between individual change notes, these blank lines
177should be stripped out, so as to make the resulting output compact.
178
179If the changelog format does not contain date or package name information
180this information should be omitted from the output. The parser should not
181attempt to synthesize it or find it from other sources.
182
183If the changelog does not have the expected format the parser should
184error out, rather than trying to muddle through and possibly generating
185incorrect output.
186
187A changelog parser may not interact with the user at all.
188.
189.SH NOTES
190All \fBParser Options\fP except for \fB\-v\fP are only supported
191since dpkg 1.14.16.
192.PP
193Short option parsing with non-bundled values available only since dpkg 1.18.0.
194.
195.SH FILES
196.TP
197.B debian/changelog
198The changelog file, used to obtain version-dependent information about
199the source package, such as the urgency and distribution of an upload,
200the changes made since a particular release, and the source version
201number itself.
202.
203.SH SEE ALSO
204.BR deb\-changelog (5).