dpkg-parsechangelog.1 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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-2013 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 "2013-04-02" "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 \-S ", " \-\-show\-field " \fIfield\fP"
  57. Specifies the name of the field to show (since dpkg 1.17.0).
  58. The field name is not printed, only its value.
  59. .TP
  60. .BR \-? ", " \-\-help
  61. Show the usage message and exit.
  62. .TP
  63. .BR \-\-version
  64. Show the version and exit.
  65. .SS Parser Options
  66. The following options can be used to influence the output of
  67. the changelog parser, e.g. the range of entries or the format
  68. of the output. They need to be supported by the parser script
  69. in question. See also \fBNOTES\fP.
  70. .TP
  71. .BI \-\-format " output-format"
  72. Set the output format. Currently supported values are
  73. .IR dpkg " and " rfc822 .
  74. \fIdpkg\fP is the classic output format (from before this
  75. option existed) and the default. It consists of one paragraph
  76. in Debian control format (see \fBdeb\-control\fP(5)). If more
  77. than one entry is requested, then most fields are taken from the
  78. most recent entry, except otherwise stated:
  79. .RS
  80. .TP
  81. .BI Source: " pkg-name"
  82. .TP
  83. .BI Version: " version"
  84. .TP
  85. .BI Distribution: " target-distribution"
  86. .TP
  87. .BI Urgency: " urgency"
  88. The highest urgency of all included entries is used, followed by the
  89. concatenated (space-separated) comments from all the versions requested.
  90. .TP
  91. .BI Maintainer: " author"
  92. .TP
  93. .BI Date: " date"
  94. .TP
  95. .BI Closes: " bug-number"
  96. The Closes fields of all included entries are merged.
  97. .TP
  98. .BI Changes: " changelog-entries"
  99. The text of all changelog entries is concatenated. To make
  100. this field a valid Debian control format multiline field
  101. empty lines are replaced with a single full stop and all lines
  102. is intended by one space character. The exact content depends
  103. on the changelog format.
  104. .RE
  105. .IP
  106. The \fBVersion\fP, \fBDistribution\fP, \fBUrgency\fP, \fBMaintainer\fP and
  107. \fBChanges\fP fields are mandatory.
  108. .IP
  109. There might be additional user-defined fields present.
  110. .IP
  111. The \fBrfc822\fP format uses the same fields but outputs
  112. a separate paragraph for each changelog entry so that all
  113. metadata for each entry is preserved.
  114. .TP
  115. .BR \-\-since " \fIversion\fP, " \-s \fIversion\fP, " \-v" \fIversion\fP
  116. include all changes later than \fIversion\fP.
  117. .TP
  118. .BR \-\-until " \fIversion\fP, " \-u \fIversion\fP
  119. include all changes earlier than \fIversion\fP.
  120. .TP
  121. .BR \-\-from " \fIversion\fP, " \-f \fIversion\fP
  122. include all changes equal or later than \fIversion\fP.
  123. .TP
  124. .BR \-\-to " \fIversion\fP, " \-t \fIversion\fP
  125. include all changes up to or equal than \fIversion\fP.
  126. .TP
  127. .BR \-\-count " \fInumber\fP, " \-c "\fInumber\fP, " \-n \fInumber\fP
  128. include \fInumber\fP entries from the top (or the tail
  129. if \fInumber\fP is lower than 0).
  130. .TP
  131. .BR \-\-offset " \fInumber\fP, " \-o \fInumber\fP
  132. change the starting point for \fB\-\-count\fP, counted from the top
  133. (or the tail if \fInumber\fP is lower than 0).
  134. .TP
  135. .B \-\-all
  136. include all changes. Note: other options have no effect when this is in
  137. use.
  138. .
  139. .SH CHANGELOG FORMATS
  140. It is possible to use a different format to the standard one, by providing
  141. a parser for that alternative format.
  142. In order to have \fBdpkg\-parsechangelog\fP run the new parser, a line must
  143. be included within the last 40 lines of the changelog file, matching the Perl
  144. regular expression: \(lq\fB\\schangelog-format:\\s+([0-9a-z]+)\\W\fP\(rq.
  145. The part in parentheses should be the name of the format. For example:
  146. @@@ changelog-format: \fIotherformat\fP @@@
  147. Changelog format names are non-empty strings of alphanumerics.
  148. If such a line exists then \fBdpkg\-parsechangelog\fP will look for
  149. the parser as \fB/usr/lib/dpkg/parsechangelog/\fP\fIotherformat\fP
  150. or \fB/usr/local/lib/dpkg/parsechangelog/\fP\fIotherformat\fP; it is
  151. an error for it not being present or not being an executable program.
  152. The default changelog format is \fBdebian\fP, and a parser for it is
  153. provided by default.
  154. The parser will be invoked with the changelog open on standard input at
  155. the start of the file. It should read the file (it may seek if it wishes)
  156. to determine the information required and return the parsed information
  157. to standard output in the format specified by the \fB\-\-format\fP option.
  158. It should accept all \fBParser Options\fP.
  159. If the changelog format which is being parsed always or almost always
  160. leaves a blank line between individual change notes, these blank lines
  161. should be stripped out, so as to make the resulting output compact.
  162. If the changelog format does not contain date or package name information
  163. this information should be omitted from the output. The parser should not
  164. attempt to synthesize it or find it from other sources.
  165. If the changelog does not have the expected format the parser should exit
  166. with a nonzero exit status, rather than trying to muddle through and
  167. possibly generating incorrect output.
  168. A changelog parser may not interact with the user at all.
  169. .
  170. .SH NOTES
  171. All \fBParser Options\fP except for \fB\-v\fP are only supported
  172. since dpkg 1.14.16. Third party parsers for
  173. changelog formats other than \fIdebian\fP might not support
  174. all options.
  175. .
  176. .SH FILES
  177. .TP
  178. .B debian/changelog
  179. The changelog file, used to obtain version-dependent information about
  180. the source package, such as the urgency and distribution of an upload,
  181. the changes made since a particular release, and the source version
  182. number itself.