1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
.\" dpkg manual page - dpkg-parsechangelog(1)
.\"
.\" Copyright © 1995-1996 Ian Jackson <ian@chiark.chu.cam.ac.uk>
.\" Copyright © 2000 Wichert Akkerman <wakkerma@debian.org>
.\" Copyright © 2006, 2012 Guillem Jover <guillem@debian.org>
.\" Copyright © 2007-2008 Frank Lichtenheld <djpig@debian.org>
.\" Copyright © 2009 Raphaël Hertzog <hertzog@debian.org>
.\"
.\" This is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
.
.TH dpkg\-parsechangelog 1 "2012-05-04" "Debian Project" "dpkg utilities"
.SH NAME
dpkg\-parsechangelog \- parse Debian changelog files
.
.SH SYNOPSIS
.B dpkg\-parsechangelog
.RI [ option ...]
.
.SH DESCRIPTION
.B dpkg\-parsechangelog
reads and parses the changelog of an unpacked Debian source tree and
outputs the information in it to standard output in a machine-readable
form.
.
.SH OPTIONS
.TP
.BI \-l changelog-file
Specifies the changelog file to read information from. The
default is
.BR debian/changelog .
.TP
.BI \-F changelog-format
Specifies the format of the changelog. By default the format is read
from a special line near the bottom of the changelog or failing that
defaults to the \fIdebian\fP standard format. See also
\fBCHANGELOG FORMATS\fP.
.TP
.BI \-L libdir
Specify an additional directory to search for parser scripts.
This directory is searched before the default directories
which are currently
.BR /usr/local/lib/dpkg/parsechangelog " and "
.BR /usr/lib/dpkg/parsechangelog .
.TP
.BR \-h ", " \-\-help
Show the usage message and exit.
.TP
.BR \-\-version
Show the version and exit.
.SS Parser Options
The following options can be used to influence the output of
the changelog parser, e.g. the range of entries or the format
of the output. They need to be supported by the parser script
in question. See also \fBCAVEATS\fP.
.TP
.BI \-\-format " output-format"
Set the output format. Currently supported values are
.IR dpkg " and " rfc822 .
\fIdpkg\fP is the classic output format (from before this
option existed) and the default. It consists of one paragraph
in Debian control format (see \fBdeb\-control\fP(5)). If more
than one entry is requested, then most fields are taken from the
most recent entry, except otherwise stated:
.RS
.TP
.BI Source: " pkg-name"
.TP
.BI Version: " version"
.TP
.BI Distribution: " target-distribution"
.TP
.BI Urgency: " urgency"
The highest urgency of all included entries is used, followed by the
concatenated (space-separated) comments from all the versions requested.
.TP
.BI Maintainer: " author"
.TP
.BI Date: " date"
.TP
.BI Closes: " bug-number"
The Closes fields of all included entries are merged.
.TP
.BI Changes: " changelog-entries"
The text of all changelog entries is concatenated. To make
this field a valid Debian control format multiline field
empty lines are replaced with a single full stop and all lines
is intended by one space character. The exact content depends
on the changelog format.
.RE
.IP
The \fBVersion\fP, \fBDistribution\fP, \fBUrgency\fP, \fBMaintainer\fP and
\fBChanges\fP fields are mandatory.
.IP
There might be additional user-defined fields present.
.IP
The \fBrfc822\fP format uses the same fields but outputs
a separate paragraph for each changelog entry so that all
metadata for each entry is preserved.
.TP
.BR \-\-since " \fIversion\fP, " \-s \fIversion\fP, " \-v" \fIversion\fP
include all changes later than \fIversion\fP.
.TP
.BR \-\-until " \fIversion\fP, " \-u \fIversion\fP
include all changes earlier than \fIversion\fP.
.TP
.BR \-\-from " \fIversion\fP, " \-f \fIversion\fP
include all changes equal or later than \fIversion\fP.
.TP
.BR \-\-to " \fIversion\fP, " \-t \fIversion\fP
include all changes up to or equal than \fIversion\fP.
.TP
.BR \-\-count " \fInumber\fP, " \-c "\fInumber\fP, " \-n \fInumber\fP
include \fInumber\fP entries from the top (or the tail
if \fInumber\fP is lower than 0).
.TP
.BR \-\-offset " \fInumber\fP, " \-o \fInumber\fP
change the starting point for \-\-count, counted from the top
(or the tail if \fInumber\fP is lower than 0).
.TP
.B \-\-all
include all changes. Note: other options have no effect when this is in
use.
.
.SH CHANGELOG FORMATS
It is possible to use a different format to the standard one, by providing
a parser for that alternative format.
In order to have \fBdpkg\-parsechangelog\fP run the new parser, a line must
be included within the last 40 lines of the changelog file, matching the Perl
regular expression: \(lq\fB\\schangelog-format:\\s+([0-9a-z]+)\\W\fP\(rq.
The part in parentheses should be the name of the format. For example:
@@@ changelog-format: \fIotherformat\fP @@@
Changelog format names are non-empty strings of alphanumerics.
If such a line exists then \fBdpkg\-parsechangelog\fP will look for
the parser as \fB/usr/lib/dpkg/parsechangelog/\fP\fIotherformat\fP
or \fB/usr/local/lib/dpkg/parsechangelog/\fP\fIotherformat\fP; it is
an error for it not being present or not being an executable program.
The default changelog format is \fBdebian\fP, and a parser for it is
provided by default.
The parser will be invoked with the changelog open on standard input at
the start of the file. It should read the file (it may seek if it wishes)
to determine the information required and return the parsed information
to standard output in the format specified by the \fB\-\-format\fP option.
It should accept all \fBParser Options\fP.
If the changelog format which is being parsed always or almost always
leaves a blank line between individual change notes, these blank lines
should be stripped out, so as to make the resulting output compact.
If the changelog format does not contain date or package name information
this information should be omitted from the output. The parser should not
attempt to synthesize it or find it from other sources.
If the changelog does not have the expected format the parser should exit
with a nonzero exit status, rather than trying to muddle through and
possibly generating incorrect output.
A changelog parser may not interact with the user at all.
.
.SH CAVEATS
All \fBParser Options\fP except for \-v are only supported in
\fBdpkg\fP, version 1.14.16 and later. Third party parsers for
changelog formats other than \fIdebian\fP might not support
all options.
.
.SH FILES
.TP
.B debian/changelog
The changelog file, used to obtain version-dependent information about
the source package, such as the urgency and distribution of an upload,
the changes made since a particular release, and the source version
number itself.
|