chiark / gitweb /
devscripts (2.10.69+squeeze4) stable-security; urgency=high
[devscripts.git] / scripts / debchange.1
1 .TH DEBCHANGE 1 "Debian Utilities" "DEBIAN" \" -*- nroff -*-
2 .SH NAME
3 debchange \- Tool for maintenance of the debian/changelog file in a source package
4 .SH SYNOPSIS
5 \fBdebchange\fR [\fIoptions\fR] [\fItext\fR ...]
6 .br
7 \fBdch\fR [\fIoptions\fR] [\fItext\fR ...]
8 .SH DESCRIPTION
9 \fBdebchange\fR or its alias \fBdch\fR will add a new comment line to
10 the Debian changelog in the current source tree.  This command must be
11 run from within that tree.  If the text of the change is given on the
12 command line, \fBdebchange\fR will run in batch mode and simply add the
13 text, with line breaks as necessary, at the appropriate place in
14 \fIdebian/changelog\fR (or the changelog specified by options, as
15 described below).  If no text is specified then \fBdebchange\fR
16 will run the editor as determined by \fBsensible-editor\fR for you to
17 edit the file.  (The environment variables \fBVISUAL\fR and
18 \fBEDITOR\fR are used in this order to determine which editor to use.)
19 Editors which understand the \fI+n\fR option for starting the editing
20 on a specified line will use this to move to the correct line of the
21 file for editing.  If the editor is quit without modifying the
22 temporary file, \fBdebchange\fR will exit without touching the
23 existing changelog.  \fBNote that the changelog is assumed to be
24 encoded with the UTF-8 encoding.  If it is not, problems may occur.\fR
25 Please see the \fBiconv\fR(1) manpage to find out how to convert
26 changelogs from legacy encodings.  Finally, a changelog or NEWS
27 file can be created from scratch using the \fB\-\-create\fR option
28 described below.
29 .PP
30 \fBdebchange\fR also supports automatically producing bug-closing
31 changelog entries, using the \fB\-\-closes\fR option.  This will
32 usually query the BTS, the Debian Bug Tracking System (see
33 http://bugs.debian.org/) to determine the title of the bug and the
34 package in which it occurs.  This behaviour can be stopped by giving a
35 \fB\-\-noquery\fR option or by setting the configuration variable
36 \fBDEBCHANGE_QUERY_BTS\fR to \fIno\fR, as described below.  In either
37 case, the editor (as described above) will always be invoked to give
38 an opportunity to modify the entries, and the changelog will be
39 accepted whether or not modifications are made.  An extra changelog
40 entry can be given on the command line in addition to the closes
41 entries.
42 .PP
43 At most one of \fB\-\-append\fR, \fB\-\-increment\fR, \fB\-\-edit\fR,
44 \fB\-\-release\fR, and \fB\-\-newversion\fR may be specified as listed
45 below. If no options are specified, \fBdebchange\fR will use heuristics to
46 guess whether or not the package has been successfully released, and behave
47 as if \fB\-\-increment\fR had been specified if the package has been
48 released, or otherwise as if \fB\-\-append\fR has been specified.
49 .PP
50 Two different sets of heuristics can be used, as controlled by the
51 \fB\-\-release-heuristic\fR option or the
52 \fBDEBCHANGE_RELEASE_HEURISTIC\fR configuration variable. The default
53 \fIlog\fR heuristic determines if a package has been released by looking for an
54 appropriate \fBdupload\fR(1) or \fBdput\fR(1) log file in the parent
55 directory. A warning will be issued if the log file is found but a
56 successful upload is not recorded. This may be because the previous upload
57 was performed with a version of \fBdupload\fR prior to 2.1 or because the
58 upload failed. The alternate \fIchangelog\fR heuristic assumes the package has
59 been released unless its changelog contains \fIUNRELEASED\fR in the
60 distribution field. If this heuristic is enabled then the distribution will
61 default to \fIUNRELEASED\fR in new changelog entries, and the
62 \fB\-\-mainttrailer\fR option described below will be automatically
63 enabled. This can be useful if a package can be released by different
64 maintainers, or if you do not keep the upload logs.
65 .PP
66 If either \fB\-\-increment\fR or \fB\-\-newversion\fR is used, the
67 name and email for the new version will be determined as follows.  If
68 the environment variable \fBDEBFULLNAME\fR is set, this will be used
69 for the maintainer full name; if not, then \fBNAME\fR will be checked.
70 If the environment variable \fBDEBEMAIL\fR is set, this will be used
71 for the email address.  If this variable has the form "name <email>",
72 then the maintainer name will also be taken from here if neither
73 \fBDEBFULLNAME\fR nor \fBNAME\fR is set.  If this variable is not set,
74 the same test is performed on the environment variable \fBEMAIL\fR.
75 Next, if the full name has still not been determined, then use
76 \fBgetpwuid\fR(3) to determine the name from the password file.  If
77 this fails, use the previous changelog entry.  For the email address,
78 if it has not been set from \fBDEBEMAIL\fR or \fBEMAIL\fR, then look
79 in \fI/etc/mailname\fR, then attempt to build it from the username and
80 FQDN, otherwise use the email address in the previous changelog entry.
81 In other words, it's a good idea to set \fBDEBEMAIL\fR and
82 \fBDEBFULLNAME\fR when using this script.
83 .PP
84 Support is included for changelogs that record changes by multiple
85 co-maintainers of a package. If an entry is appended to the current
86 version's entries, and the maintainer is different from the maintainer who
87 is listed as having done the previous entries, then lines will be added to
88 the changelog to tell which maintainers made which changes. Currently only
89 one of the several such styles of recording this information is supported,
90 in which the name of the maintainer who made a set of changes appears
91 on a line before the changes, inside square brackets. This can be
92 switched on and off using the \fB\-\-[no]multimaint\fR option or the
93 \fBDEBCHANGE_MULTIMAINT\fR configuration file option; the default is to
94 enable it.  Note that if an entry has already been marked in this way,
95 then this option will be silently ignored.
96 .PP
97 If the directory name of the source tree has the form
98 \fIpackage\fR-\fIversion\fR, then \fBdebchange\fR will also attempt to
99 rename it if the (upstream) version number changes.  This can be
100 prevented by using the \fB\-\-preserve\fR command line or
101 configuration file option as described below.
102 .PP
103 If \fB\-\-force\-bad\-version\fR or \fB\-\-allow\-lower\-version\fR is used,
104 \fBdebchange\fR will not stop if the new version is less than the current one.
105 This is especially useful while doing backports. 
106 .SH "Directory name checking"
107 In common with several other scripts in the \fBdevscripts\fR package,
108 \fBdebchange\fR will climb the directory tree until it finds a
109 \fIdebian/changelog\fR file.  As a safeguard against stray files
110 causing potential problems, it will examine the name of the parent
111 directory once it finds the \fIdebian/changelog\fR file, and check
112 that the directory name corresponds to the package name.  Precisely
113 how it does this is controlled by two configuration file variables
114 DEVSCRIPTS_CHECK_DIRNAME_LEVEL and DEVSCRIPTS_CHECK_DIRNAME_REGEX, and
115 their corresponding command-line options \fB\-\-check-dirname-level\fR
116 and \fB\-\-check-dirname-regex\fR.
117 .PP
118 DEVSCRIPTS_CHECK_DIRNAME_LEVEL can take the following values:
119 .TP
120 .B 0
121 Never check the directory name.
122 .TP
123 .B 1
124 Only check the directory name if we have had to change directory in
125 our search for \fIdebian/changelog\fR.  This is the default behaviour.
126 .TP
127 .B 2
128 Always check the directory name.
129 .PP
130 The directory name is checked by testing whether the current directory
131 name (as determined by \fBpwd\fR(1)) matches the regex given by the
132 configuration file option DEVSCRIPTS_CHECK_DIRNAME_REGEX or by the
133 command line option \fB\-\-check-dirname-regex\fR \fIregex\fR.  Here
134 \fIregex\fR is a Perl regex (see \fBperlre\fR(3perl)), which will be
135 anchored at the beginning and the end.  If \fIregex\fR contains a '/',
136 then it must match the full directory path.  If not, then it must
137 match the full directory name.  If \fIregex\fR contains the string
138 \'PACKAGE', this will be replaced by the source package name, as
139 determined from the changelog.  The default value for the regex is:
140 \'PACKAGE(-.+)?', thus matching directory names such as PACKAGE and
141 PACKAGE-version.
142 .PP
143 The default changelog to be edited is \fIdebian/changelog\fR; however,
144 this can be changed using the \fB\-\-changelog\fR or \fB\-\-news\fR
145 options or the CHANGELOG environment variable, as described below.
146 .SH OPTIONS
147 .TP
148 .BR \-\-append ", " \-a
149 Add a new changelog entry at the end of the current version's entries.
150 .TP
151 .BR \-\-increment ", " \-i
152 Increment either the final component of the Debian release number or,
153 if this is a native Debian package, the version number.  This creates
154 a new section at the beginning of the changelog with appropriate
155 headers and footers.  Also, if this is a new version of a native
156 Debian package, the directory name is changed to reflect this.
157 .TP
158 \fB\-\-newversion \fIversion\fR, \fB\-v \fIversion\fR
159 This specifies the version number (including the Debian release part)
160 explicitly and behaves as the \fB\-\-increment\fR option in other
161 respects.  It will also change the directory name if the upstream
162 version number has changed.
163 .TP
164 .BR \-\-edit ", " \-e
165 Edit the changelog in an editor.
166 .TP
167 .BR \-\-release ", " \-r
168 Finalize the changelog for a release.
169 Update the changelog timestamp. If the distribution is set to
170 \fIUNRELEASED\fR, change it to the distribution from the previous changelog entry 
171 (or another distribution as specified by \fB\-\-distribution\fR).  If there are 
172 no previous changelog entries and an explicit distribution has not been 
173 specified, \fIunstable\fR will be used.
174 .TP
175 .BR \-\-force\-save\-on\-release
176 When \-\-release is used and an editor opened to allow inspection
177 of the changelog, require the user to save the changelog their editor opened.
178 Otherwise, the original changelog will not be modified. (default)
179 .TP
180 .BR \-\-no\-force\-save\-on\-release
181 Do not do so. Note that a dummy changelog entry made be supplied
182 in order to achieve the same effect - e.g. \fBdebchange \-\-release ""\fR.
183 The entry will not be added to the changelog but its presence will suppress
184 the editor.
185 .TP
186 .BR \-\-create
187 This will create a new \fIdebian/changelog\fR file (or \fINEWS\fR if
188 the \fB\-\-news\fR option is used).  You must be in the top-level
189 directory to use this; no directory name checking will be performed.
190 The package name and version can either be specified using the
191 \fB\-\-package\fR and \fB\-\-newversion\fR options, determined from
192 the directory name using the \fB\-\-fromdirname\fR option or entered
193 manually into the generated changelog file.  The maintainer name is
194 determined from the environment if this is possible, and the
195 distribution is specified either using the \fB\-\-distribution\fR
196 option or in the generated changelog file.
197 .TP
198 .BR \-\-empty
199 When used in combination with \fB\-\-create\fR, suppress the automatic
200 addition of an "initial release" changelog entry (so that the next
201 invocation of \fBdebchange\fR adds the first entry).  Note that this
202 will cause a \fBdpkg\-parsechangelog\fR warning on the next invocation
203 due to the lack of changes.
204 .TP
205 \fB\-\-package\fR \fIpackage\fR
206 This specifies the package name to be used in the new changelog; this
207 may only be used in conjunction with the \fB\-\-create\fR, \fB\-\-increment\fR and
208 \fB\-\-newversion\fR options.
209 .TP
210 .BR \-\-nmu ", " \-n
211 Increment the Debian release number for a non-maintainer upload by
212 either appending a ".1" to a non-NMU version number (unless the package
213 is Debian native, in which case "+nmu1" is appended) or by incrementing
214 an NMU version number, and add an NMU changelog comment.  This happens
215 automatically if the packager is neither in the Maintainer nor the Uploaders
216 field in \fIdebian/control\fR, unless \fBDEBCHANGE_AUTO_NMU\fR is set to
217 \fIno\fR or the \fB\-\-no\-auto\-nmu\fR option is used.
218 .TP
219 .BR \-\-bin\-nmu
220 Increment the Debian release number for a binary non-maintainer upload
221 by either appending a "+b1" to a non-binNMU version number or by
222 incrementing a binNMU version number, and add a binNMU changelog comment.
223 .TP
224 .BR \-\-qa ", " \-q
225 Increment the Debian release number for a Debian QA Team upload, and
226 add a QA upload changelog comment.
227 .TP
228 .BR \-\-security ", " \-s
229 Increment the Debian release number for a Debian Security Team non-maintainer
230 upload, and add a Security Team upload changelog comment.
231 .TP
232 .B \-\-team
233 Increment the Debian release number for a team upload, and add a team upload
234 changelog comment.
235 .TP
236 .B \-\-bpo
237 Increment the Debian release number for an upload to lenny-backports,
238 and add a backport upload changelog comment.
239 .TP
240 .BR \-\-local ", " \-l \fIsuffix\fR
241  Add a suffix to the Debian version number for a local build.
242 .TP
243 .BR \-\-force\-bad\-version ", " \-b
244 Force a version number to be less than the current one (e.g., when
245 backporting).
246 .TP
247 .BR \-\-allow\-lower\-version
248 Allow a version number to be less than the current one if the new version
249 matches the specified pattern.
250 .TP
251 .BR \-\-force\-distribution
252 Force the provided distribution to be used, even if it doesn't match the list of known 
253 distributions (e.g. for unofficial distributions).
254 .TP
255 .BR \-\-auto\-nmu
256 Attempt to automatically determine whether a change to the changelog
257 represents a Non Maintainer Upload.  This is the default.
258 .TP
259 .BR \-\-no\-auto\-nmu
260 Disable automatic NMU detection.  Equivalent to setting
261 \fBDEBCHANGE_AUTO_NMU\fR to \fIno\fR.
262 .TP
263 .BR \-\-fromdirname ", " \-d
264 This will take the upstream version number from the directory name,
265 which should be of the form \fIpackage\fR-\fIversion\fR.  If the
266 upstream version number has increased from the most recent changelog
267 entry, then a new entry will be made with version number
268 \fIversion\fR-1 (or \fIversion\fR if the package is Debian native),
269 with the same epoch as the previous package version.  If the upstream
270 version number is the same, this option will behave in the same way as
271 \fB\-i\fR.
272 .TP
273 .BI \-\-closes " nnnnn,[nnnnn,...]"
274 Add changelog entries to close the specified bug numbers.  Also invoke
275 the editor after adding these entries.  Will generate warnings if the
276 BTS cannot be contacted (and \fB\-\-noquery\fR has not been
277 specified), or if there are problems with the bug report located.
278 .TP
279 .B \-\-[no]query
280 Should we attempt to query the BTS when generating closes entries?
281 .TP
282 .BR \-\-preserve ", " \-p
283 Preserve the source tree directory name if the upstream version number
284 (or the version number of a Debian native package) changes.  See also
285 the configuration variables section below.
286 .TP
287 \fB \-\-no\-preserve\fR, \fB\-\-nopreserve\fR
288 Do not preserve the source tree directory name (default).
289 .TP
290 \fB\-\-distribution \fIdist\fR, \fB\-D \fIdist\fR
291 Use the specified distribution in the changelog entry being edited,
292 instead of using the previous changelog entry's distribution for new
293 entries or the existing value for existing entries.
294 .TP
295 \fB\-\-urgency \fIurgency\fR, \fB\-u \fIurgency\fR
296 Use the specified urgency in the changelog entry being edited,
297 instead of using the default "low" for new entries or the existing
298 value for existing entries.
299 .TP
300 \fB\-\-changelog \fIfile\fR, \fB\-c \fIfile\fR
301 This will edit the changelog \fIfile\fR instead of the standard
302 \fIdebian/changelog\fR.  This option overrides any CHANGELOG
303 environment variable setting.  Also, no directory traversing or
304 checking will be performed when this option is used.
305 .TP
306 \fB\-\-news\fR [\fInewsfile\fR]
307 This will edit \fInewsfile\fR (by default, \fIdebian/NEWS\fR) instead
308 of the regular changelog.  Directory searching will be performed.
309 The changelog will be examined in order to determine the current package 
310 version.
311 .TP
312 \fB\-\-[no]multimaint\fR
313 Should we indicate that parts of a changelog entry have been made by
314 different maintainers?  Default is yes; see the discussion above and
315 also the \fBDEBCHANGE_MULTIMAINT\fR configuration file option below.
316 .TP
317 \fB\-\-[no]multimaint\-merge\fR
318 Should all changes made by the same author be merged into the same
319 changelog section?  Default is no; see the discussion above and also the
320 \fBDEBCHANGE_MULTIMAINT_MERGE\fR configuration file option below.
321 .TP
322 .BR \-\-maintmaint ", " \-m
323 Do not modify the maintainer details previously listed in the changelog. 
324 This is useful particularly for sponsors wanting to automatically add a
325 sponsorship message without disrupting the other changelog details.
326 Note that there may be some interesting interactions if
327 multi-maintainer mode is in use; you will probably wish to check the
328 changelog manually before uploading it in such cases.
329 .TP
330 .BR \-\-[no]mainttrailer ", " \-t
331 If mainttrailer is set, it will avoid modifying the existing changelog
332 trailer line (i.e. the maintainer and date-stamp details), unless
333 used with options that require the trailer to be modified
334 (e.g. \fB\-\-create\fR, \fB\-\-release\fR, \fB\-i\fR, \fB\-\-qa\fR, etc.)
335 This option differs from \fB\-\-maintmaint\fR in that it will use
336 multi-maintainer mode if appropriate, with the exception of editing the
337 trailer. See also the \fBDEBCHANGE_MAINTTRAILER\fR configuration file option 
338 below.
339 .TP
340 \fB\-\-check-dirname-level\fR \fIN\fR
341 See the above section "Directory name checking" for an explanation of
342 this option.
343 .TP
344 \fB\-\-check-dirname-regex\fR \fIregex\fR
345 See the above section "Directory name checking" for an explanation of
346 this option.
347 .TP
348 \fB\-\-no-conf\fR, \fB\-\-noconf\fR
349 Do not read any configuration files.  This can only be used as the
350 first option given on the command-line.
351 .TP
352 \fB\-\-release\-heuristic\fR \fIlog|changelog\fR
353 Controls how \fBdebchange\fR determines if a package has been released,
354 when deciding whether to create a new changelog entry or append to an
355 existing changelog entry.
356 .TP
357 .BR \-\-help ", " \-h
358 Display a help message and exit successfully.
359 .TP
360 .B \-\-version
361 Display version and copyright information and exit successfully.
362 .SH "CONFIGURATION VARIABLES"
363 The two configuration files \fI/etc/devscripts.conf\fR and
364 \fI~/.devscripts\fR are sourced in that order to set configuration
365 variables.  Command line options can be used to override configuration
366 file settings.  Environment variable settings are ignored for this
367 purpose.  The currently recognised variables are:
368 .TP
369 .B DEBCHANGE_PRESERVE
370 If this is set to \fIyes\fR, then it is the same as the
371 \fB\-\-preserve\fR command line parameter being used.
372 .TP
373 .B DEBCHANGE_QUERY_BTS
374 If this is set to \fIno\fR, then it is the same as the
375 \fB\-\-noquery\fR command line parameter being used.
376 .TP
377 .BR DEVSCRIPTS_CHECK_DIRNAME_LEVEL ", " DEVSCRIPTS_CHECK_DIRNAME_REGEX
378 See the above section "Directory name checking" for an explanation of
379 these variables.  Note that these are package-wide configuration
380 variables, and will therefore affect all \fBdevscripts\fR scripts
381 which check their value, as described in their respective manpages and
382 in \fBdevscripts.conf\fR(5).
383 .TP
384 .BR DEBCHANGE_RELEASE_HEURISTIC
385 Controls how \fBdebchange\fR determines if a package has been released,
386 when deciding whether to create a new changelog entry or append to an
387 existing changelog entry. Can be either \fIlog\fR or \fIchangelog\fR.
388 .TP
389 .BR DEBCHANGE_MULTIMAINT
390 If set to \fIno\fR, \fBdebchange\fR will not introduce multiple-maintainer
391 distinctions when a different maintainer appends an entry to an
392 existing changelog.  See the discussion above.  Default is \fIyes\fR.
393 .TP
394 .BR DEBCHANGE_MULTIMAINT_MERGE
395 If set to \fIyes\fR, when adding changes in multiple-maintainer mode
396 \fBdebchange\fR will check whether previous changes by the current
397 maintainer exist and add the new changes to the existing block
398 rather than creating a new block.  Default is \fIno\fR.
399 .TP
400 .BR DEBCHANGE_MAINTTRAILER
401 If this is set to \fIno\fR, then it is the same as the
402 \fB\-\-nomainttrailer\fR command line parameter being used.
403 .TP
404 .BR DEBCHANGE_TZ
405 Use this timezone for changelog entries.  Default is the user/system
406 timezone as shown by `date \-R` and affected by the environment variable TZ.
407 .TP
408 .BR DEBCHANGE_LOWER_VERSION_PATTERN
409 If this is set, then it is the same as the
410 \fB\-\-allow\-lower\-version\fR command line parameter being used.
411 .TP
412 .BR DEBCHANGE_AUTO_NMU
413 If this is set to \fIno\fR then \fBdebchange\fR will not attempt to
414 automatically determine whether the current changelog stanza represents
415 an NMU.  The default is \fIyes\fR.  See the discussion of the
416 \fB\-\-nmu\fR option above.
417 .TP
418 .BR DEBCHANGE_FORCE_SAVE_ON_RELEASE
419 If this is set to \fIno\fR, then it is the same as the
420 \fB\-\-no\-force\-save\-on\-release\fR command line parameter being used.
421 .SH ENVIRONMENT
422 .TP
423 .BR DEBEMAIL ", " EMAIL ", " DEBFULLNAME ", " NAME
424 See the above description of the use of these environment variables.
425 .TP
426 .B CHANGELOG
427 This variable specifies the changelog to edit in place of
428 \fIdebian/changelog\fR.  No directory traversal or checking is
429 performed when this variable is set.  This variable is overridden by
430 the \fB\-\-changelog\fR command-line setting.
431 .TP
432 .BR VISUAL ", " EDITOR
433 These environment variables (in this order) determine the editor used
434 by \fBsensible-editor\fR.
435 .SH "SEE ALSO"
436 .BR debclean (1),
437 .BR dupload (1),
438 .BR dput (1),
439 .BR debc (1)
440 and
441 .BR devscripts.conf (5).
442 .SH AUTHOR
443 The original author was Christoph Lameter <clameter@debian.org>. 
444 Many substantial changes and improvements were made by Julian Gilbey
445 <jdg@debian.org>.