dpkg-parsechangelog.1 6.9 KB

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