dpkg-parsechangelog.man 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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 "%RELEASE_DATE%" "%VERSION%" "dpkg utilities"
  23. .nh
  24. .SH NAME
  25. dpkg\-parsechangelog \- parse Debian changelog files
  26. .
  27. .SH SYNOPSIS
  28. .B dpkg\-parsechangelog
  29. .RI [ option ...]
  30. .
  31. .SH DESCRIPTION
  32. .B dpkg\-parsechangelog
  33. reads and parses the changelog of an unpacked Debian source tree and
  34. outputs the information in it to standard output in a machine-readable
  35. form.
  36. .
  37. .SH OPTIONS
  38. .TP
  39. .BR \-l " \fIchangelog-file\fP"
  40. Specifies the changelog file to read information from.
  41. A ‘\-’ can be used to specify reading from standard input.
  42. The default is
  43. .BR debian/changelog .
  44. .TP
  45. .BR \-F " \fIchangelog-format\fP"
  46. Specifies the format of the changelog. By default the format is read
  47. from a special line near the bottom of the changelog or failing that
  48. defaults to the \fBdebian\fP standard format. See also
  49. \fBCHANGELOG FORMATS\fP.
  50. .TP
  51. .BR \-L " \fIlibdir\fP"
  52. Obsolete option without effect (since dpkg 1.18.8).
  53. Setting the perl environment variables \fBPERL5LIB\fP or \fBPERLLIB\fP
  54. has a similar effect when looking for the parser perl modules.
  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.
  69. .TP
  70. .BI \-\-file " file"
  71. Set the changelog filename to parse.
  72. Default is ‘-’ (standard input).
  73. .TP
  74. .BR \-l ", " \-\-label " \fIfile\fP"
  75. Set the name of the changelog file to use in error messages, instead
  76. of using the name from the \fB\-\-file\fP option, or its default value.
  77. .TP
  78. .BI \-\-format " output-format"
  79. Set the output format. Currently supported values are
  80. .BR dpkg " and " rfc822 .
  81. \fBdpkg\fP is the classic output format (from before this
  82. option existed) and the default. It consists of one paragraph
  83. in Debian control format (see \fBdeb\-control\fP(5)). If more
  84. than one entry is requested, then most fields are taken from the
  85. most recent entry, except otherwise stated:
  86. .RS
  87. .TP
  88. .BI Source: " pkg-name"
  89. .TP
  90. .BI Version: " version"
  91. .TP
  92. .BI Distribution: " target-distribution"
  93. .TP
  94. .BI Urgency: " urgency"
  95. The highest urgency of all included entries is used, followed by the
  96. concatenated (space-separated) comments from all the versions requested.
  97. .TP
  98. .BI Maintainer: " author"
  99. .TP
  100. .BI Date: " date"
  101. The date of the entry as a string, as it appears in the changelog.
  102. With a \fBstrptime\fP(3) format "\fB%a, %d %b %Y %T %z\fP", but where the
  103. day of the week might not actually correspond to the real day obtained
  104. from the rest of the date string.
  105. If you need a more accurate representation of the date, use the
  106. \fBTimestamp\fP field, but take into account it might not be possible to
  107. map it back to the exact value in this field.
  108. .TP
  109. .BI Timestamp: " timestamp"
  110. The date of the entry as a timestamp in seconds since the epoch
  111. (since dpkg 1.18.8).
  112. .TP
  113. .BI Closes: " bug-number"
  114. The Closes fields of all included entries are merged.
  115. .TP
  116. .BI Changes: " changelog-entries"
  117. The text of all changelog entries is concatenated. To make
  118. this field a valid Debian control format multiline field
  119. empty lines are replaced with a single full stop and all lines
  120. is intended by one space character. The exact content depends
  121. on the changelog format.
  122. .RE
  123. .IP
  124. The \fBVersion\fP, \fBDistribution\fP, \fBUrgency\fP, \fBMaintainer\fP and
  125. \fBChanges\fP fields are mandatory.
  126. .IP
  127. There might be additional user-defined fields present.
  128. .IP
  129. The \fBrfc822\fP format uses the same fields but outputs
  130. a separate paragraph for each changelog entry so that all
  131. metadata for each entry is preserved.
  132. .TP
  133. .B \-\-all
  134. Include all changes. Note: other options have no effect when this is in use.
  135. .TP
  136. .BR \-s ", " \-\-since " \fIversion\fP"
  137. .TQ
  138. .BR \-v " \fIversion\fP"
  139. Include all changes later than \fIversion\fP.
  140. .TP
  141. .BR \-u ", " \-\-until " \fIversion\fP"
  142. Include all changes earlier than \fIversion\fP.
  143. .TP
  144. .BR \-f ", " \-\-from " \fIversion\fP"
  145. Include all changes equal or later than \fIversion\fP.
  146. .TP
  147. .BR \-t ", " \-\-to " \fIversion\fP"
  148. Include all changes up to or equal than \fIversion\fP.
  149. .TP
  150. .BR \-c ", " \-\-count " \fInumber\fP"
  151. .TQ
  152. .BR \-n " \fInumber\fP"
  153. Include \fInumber\fP entries from the top (or the tail
  154. if \fInumber\fP is lower than 0).
  155. .TP
  156. .BR \-o ", " \-\-offset " \fInumber\fP"
  157. Change the starting point for \fB\-\-count\fP, counted from the top
  158. (or the tail if \fInumber\fP is lower than 0).
  159. .
  160. .SH CHANGELOG FORMATS
  161. It is possible to use a different format to the standard one, by providing
  162. a parser for that alternative format.
  163. In order to have \fBdpkg\-parsechangelog\fP run the new parser, a line must
  164. be included within the last 40 lines of the changelog file, matching the Perl
  165. regular expression: “\fB\\schangelog-format:\\s+([0-9a-z]+)\\W\fP”.
  166. The part in parentheses should be the name of the format. For example:
  167. @@@ changelog-format: \fIotherformat\fP @@@
  168. Changelog format names are non-empty strings of alphanumerics.
  169. If such a line exists then \fBdpkg\-parsechangelog\fP will look for
  170. the parser as a \fBDpkg::Changelog::\fP\fIOtherformat\fP perl module;
  171. it is an error for it not being present.
  172. The parser name in the perl module will be automatically capitalized.
  173. The default changelog format is \fBdebian\fP, and a parser for it is
  174. provided by default.
  175. The parser should be derived from the Dpkg::Changelog class and implement
  176. the required documented interface.
  177. If the changelog format which is being parsed always or almost always
  178. leaves a blank line between individual change notes, these blank lines
  179. should be stripped out, so as to make the resulting output compact.
  180. If the changelog format does not contain date or package name information
  181. this information should be omitted from the output. The parser should not
  182. attempt to synthesize it or find it from other sources.
  183. If the changelog does not have the expected format the parser should
  184. error out, rather than trying to muddle through and possibly generating
  185. incorrect output.
  186. A changelog parser may not interact with the user at all.
  187. .
  188. .SH NOTES
  189. All \fBParser Options\fP except for \fB\-v\fP are only supported
  190. since dpkg 1.14.16.
  191. .PP
  192. Short option parsing with non-bundled values available only since dpkg 1.18.0.
  193. .
  194. .SH FILES
  195. .TP
  196. .B debian/changelog
  197. The changelog file, used to obtain version-dependent information about
  198. the source package, such as the urgency and distribution of an upload,
  199. the changes made since a particular release, and the source version
  200. number itself.
  201. .
  202. .SH SEE ALSO
  203. .BR deb\-changelog (5).