dpkg-parsechangelog.1 7.0 KB

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