dpkg-parsechangelog.1 7.4 KB

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