debconf.desc 12.9 KB
Newer Older
1
Check-Script: debconf
Colin Watson's avatar
Colin Watson committed
2
Author: Colin Watson <cjwatson@debian.org>
3
Abbrev: dc
4
Type: binary, udeb, source
5
Info: This looks for common mistakes in packages using debconf.
6
Needs-Info: bin-pkg-control, unpacked, scripts
7 8

Tag: missing-debconf-dependency
9 10
Severity: normal
Certainty: possible
11 12 13 14
Info: Packages using debconf should depend on it, since debconf is not an
 essential package.

Tag: missing-debconf-dependency-for-preinst
15 16
Severity: normal
Certainty: possible
Russ Allbery's avatar
Russ Allbery committed
17
Info: Packages using debconf in their preinst script must pre-depend
18
 on debconf, with appropriate discussion on &debdev;. Since debconf is
Russ Allbery's avatar
Russ Allbery committed
19 20
 almost always already installed, this is normally better than depending
 on it and falling back to a different configuration system.
21

22
Tag: unknown-field-in-templates
23 24
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
25 26
Info: Valid fields are currently "Template:", "Type:", "Choices:", "Default:",
 and "Description:".
27
Ref: debconf-spec 3.1, debconf-devel(7)
28 29

Tag: no-template-name
30 31
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
32
Info: The templates file contains a template without a "Template:" field.
33 34

Tag: malformed-template-name
35 36
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
37
Info: The "Template:" field should contain more than one component, each
38
 separated by a slash ("/"). Each component may only consist of the
Russ Allbery's avatar
Russ Allbery committed
39
 alphanumeric characters, "+", "-", and ".".
40 41

Tag: no-template-type
42 43
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
44
Info: The templates file contains a template without a "Type:" field.
45 46

Tag: unknown-template-type
47 48
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
49
Info: A "Type:" field in a templates file provided by this package uses an
50
 unknown data type. Valid types are currently "string", "boolean", "select",
Russ Allbery's avatar
Russ Allbery committed
51
 "multiselect", "note", "text", and "password".
52

Marc Brockschmidt's avatar
Marc Brockschmidt committed
53
Tag: empty-translated-choices
54 55
Severity: important
Certainty: possible
Marc Brockschmidt's avatar
Marc Brockschmidt committed
56
Info: When the translation of a Choices: field is empty, the whole question
57
 is skipped (and nothing is selected). Please verify that the translation
Marc Brockschmidt's avatar
Marc Brockschmidt committed
58 59
 you're using is valid.

60
Tag: mismatch-translated-choices
61 62
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
63
Info: A "Choices:" field is a comma separated list, and translated
64
 "Choices:" fields must have the exact same number of elements. One
65
 of the translations does not follow this rule, you should contact the
Russ Allbery's avatar
Russ Allbery committed
66
 translator and request for a new translation where elements of "Choices:"
67 68 69 70 71 72
 fields have no embedded commas.
 .
 Cdebconf understands escaped commas in such fields, but packages
 outside the scope of debian-installer must not have them until they are
 also supported by debconf.

73
Tag: select-without-choices
74 75
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
76 77
Info: Templates using the "select" or "multiselect" data types must provide
 a "Choices:" field listing the possible values of the template.
78
Ref: debconf-spec 3.1, debconf-devel(7)
79

80
Tag: boolean-template-has-bogus-default
81 82
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
83
Info: The "boolean" type in a debconf template, can have only two values: true
84
 and false. The default has been set to something different.
85
Ref: debconf-spec 3.1, debconf-devel(7)
86

87
Tag: no-template-description
88 89
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
90
Info: The templates file contains a template without a "Description:" field.
91
Ref: debconf-spec 3, debconf-devel(7)
92 93

Tag: duplicate-long-description-in-template
94 95
Severity: minor
Certainty: certain
96
Info: The long description of one of the templates provided by this package
97
 is a duplicate of the short description. If you cannot provide a good
98 99 100
 extended description, it is better to leave it blank.

Tag: config-does-not-load-confmodule
101
Severity: normal
102
Certainty: certain
103 104 105
Info: The config script must load one of the debconf libraries.

Tag: postinst-uses-db-input
106
Severity: normal
107
Certainty: possible
108
Info: It is generally not a good idea for postinst scripts to use debconf
109
 commands like <tt>db_input</tt>. Typically, they should restrict themselves
110 111 112 113
 to <tt>db_get</tt> to request previously acquired information, and have the
 config script do the actual prompting.

Tag: postinst-does-not-load-confmodule
114 115
Severity: normal
Certainty: certain
116
Info: Even if your postinst does not involve debconf, you currently need to
117
 make sure it loads one of the debconf libraries. This will be changed in
118 119
 the future.

120
Tag: loads-obsolete-confmodule
121 122
Severity: normal
Certainty: certain
123
Info: The maintainer script uses an obsolete name for a debconf confmodule.
124 125
 Shell scripts should source <tt>/usr/share/debconf/confmodule</tt>, while
 Perl scripts should use <tt>Debconf::Client::ConfModule</tt>.
126
Ref: debconf-devel(7)
127 128

Tag: postrm-does-not-purge-debconf
129 130
Severity: normal
Certainty: certain
131
Info: Packages using debconf should call <tt>db_purge</tt> or its equivalent
132
 in their postrm. If the package uses debhelper, dh_installdebconf(1) should
133 134 135
 take care of this.

Tag: isdefault-flag-is-deprecated
136 137
Severity: normal
Certainty: possible
Russ Allbery's avatar
Russ Allbery committed
138
Info: The "isdefault" flag on debconf questions is deprecated as of debconf
139
 0.5.00, and has been replaced by "seen" with the inverse meaning. From
140
 debconf 0.5 onwards there should be very few reasons to use isdefault/seen
141
 anyway, as backing up works much better now. See
142 143 144
 /usr/share/doc/debconf-doc/changelog.gz for more information.
 .
 The misuse of isdefault often leads to questions being asked twice in one
145
 installation run, or, worse, on every upgrade. Please test your package
146 147 148
 carefully to make sure this does not happen.

Tag: debconf-config-not-executable
149 150
Severity: important
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
151
Info: The debconf "config" script in the package control area must be
152 153 154
 executable.

Tag: no-debconf-config
155
Severity: important
156
Certainty: possible
Russ Allbery's avatar
Russ Allbery committed
157
Info: The package contains a "templates" file in its control area but has no
158
 corresponding "config" script. This is occasionally OK, but is usually an
159 160 161
 error.

Tag: no-debconf-templates
162 163
Severity: normal
Certainty: possible
Russ Allbery's avatar
Russ Allbery committed
164
Info: The package contains a "config" script in its control area but has no
165
 corresponding "templates" file. This is occasionally OK, but is usually an
166 167 168
 error.

Tag: debconf-is-not-a-registry
169 170
Severity: important
Certainty: wild-guess
171
Info: In the Unix tradition, Debian packages should have human-readable and
172
 human-editable configuration files. This package uses debconf commands
173
 outside its maintainer scripts, which often indicates that it is taking
174
 configuration information directly from the debconf database. Typically,
Russ Allbery's avatar
Russ Allbery committed
175 176 177 178
 packages should use debconf-supplied information to generate
 configuration files, and -- to avoid losing configuration information on
 upgrades -- should parse these configuration files in the <tt>config</tt>
 script if it is necessary to ask the user for changes.
179 180
 .
 Some standalone programs may legitimately use debconf to prompt the user
181 182
 for questions. If you maintain a package containing such a program,
 please install an override. Other exceptions to this check include
Russ Allbery's avatar
Russ Allbery committed
183
 configuration scripts called from the package's post-installation script.
184
Ref: devref 6.5.1, debconf-devel(7)
185

Russ Allbery's avatar
Russ Allbery committed
186
Tag: malformed-prompt-in-templates
187
Severity: normal
188
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
189
Info: The short description of a select, multiselect, string and password
190
 debconf template is a prompt and not a title. Avoid question style
Russ Allbery's avatar
Russ Allbery committed
191 192
 prompts ("IP Address?") in favour of "opened" prompts ("IP address:").
 The use of colons is recommended.
193 194 195
 .
 If this template is only used internally by the package and not displayed
 to the user, put "for internal use" in the short description.
Russ Allbery's avatar
Russ Allbery committed
196 197 198
Ref: devref 6.5.4.2

Tag: malformed-title-in-templates
199
Severity: normal
200
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
201 202 203 204 205 206
Info: The short description of a note debconf template should be written
 as a title and therefore should not end with a period, question mark,
 colon, or semicolon.
Ref: devref 6.5.4.2.4

Tag: malformed-question-in-templates
207
Severity: normal
208
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
209 210
Info: The short description of a boolean debconf template should be
 phrased in the form of a question which should be kept short and should
211
 generally end with a question mark. Terse writing style is permitted and
Russ Allbery's avatar
Russ Allbery committed
212
 even encouraged if the question is rather long.
213 214 215
 .
 If this template is only used internally by the package and not displayed
 to the user, put "for internal use" in the short description.
Russ Allbery's avatar
Russ Allbery committed
216 217 218
Ref: devref 6.5.4.2.2

Tag: using-question-in-extended-description-in-templates
219
Severity: normal
220
Certainty: certain
221 222
Info: The extended description of a debconf template should never include
 a question.
223 224 225
 .
 If this template is only used internally by the package and not displayed
 to the user, put "for internal use" in the short description.
226
Ref: devref 6.5.3.2
Russ Allbery's avatar
Russ Allbery committed
227 228

Tag: using-imperative-form-in-templates
229
Severity: normal
230
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
231
Info: Do not use useless imperative constructions such as "Please choose...",
232
 "Enter...". The interface will make it obvious that the user needs to
Russ Allbery's avatar
Russ Allbery committed
233 234 235 236
 choose or enter something.
Ref: devref 6.5.4.2

Tag: using-first-person-in-templates
237 238
Severity: normal
Certainty: possible
Russ Allbery's avatar
Russ Allbery committed
239
Info: You should avoid the use of first person ("I will do this..." or
240 241
 "We recommend..."). The computer is not a person and the Debconf
 templates do not speak for the Debian developers. You should use neutral
Russ Allbery's avatar
Russ Allbery committed
242
 construction and often the passive form.
243 244 245
 .
 If this template is only used internally by the package and not displayed
 to the user, put "for internal use" in the short description.
Russ Allbery's avatar
Russ Allbery committed
246 247 248
Ref: devref 6.5.2.5

Tag: making-assumptions-about-interfaces-in-templates
249 250
Severity: normal
Certainty: possible
Russ Allbery's avatar
Russ Allbery committed
251
Info: Template text should not make reference to widgets belonging to
252
 some debconf interfaces. Sentences like "If you answer Yes..." have no
Russ Allbery's avatar
Russ Allbery committed
253 254 255 256 257
 meaning for users of graphical interfaces which use checkboxes for
 boolean questions.
Ref: devref 6.5.2.4

Tag: too-long-short-description-in-templates
258 259
Severity: normal
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
260
Info: The short description should be kept short (50 characters or so) so
261
 that it may be accommodated by most debconf interfaces. Keeping it short
Russ Allbery's avatar
Russ Allbery committed
262 263 264 265 266
 also helps translators, as usually translations tend to end up being
 longer than the original.
Ref: devref 6.5.3.2

Tag: too-long-extended-description-in-templates
267 268
Severity: normal
Certainty: certain
Russ Allbery's avatar
Russ Allbery committed
269 270 271 272
Info: Some debconf interfaces cannot deal very well with descriptions of
 more than about 20 lines, so try to keep the extended description below
 this limit.
Ref: devref 6.5.3.2
Russ Allbery's avatar
Russ Allbery committed
273 274

Tag: unknown-debconf-priority
275 276
Severity: important
Certainty: certain
Jakub Wilk's avatar
Jakub Wilk committed
277
Info: The given maintainer script calls db_input or db_text with a
278
 first argument that doesn't match one of the known priorities. The
Russ Allbery's avatar
Russ Allbery committed
279 280
 supported priorities are low, medium, high, and critical.
Ref: debconf-devel(7)
281 282

Tag: possible-debconf-note-abuse
283 284
Severity: normal
Certainty: possible
285 286 287 288 289 290 291 292 293 294 295 296
Info: Debconf notes should be used only for important notes that the
 user really should see, since debconf will go to great pains to make
 sure the user sees it.
 .
 Displaying a note with a low priority is conflicting with this statement,
 since using a low or medium priority shows that the note is not
 important.
 .
 The right fix is NOT to increase the priority of the note, but to move
 it somewhere else in the inline documentation, for example in a
 README.Debian file for notes about package usability or NEWS.Debian for
 changes in the package behavior, or to simply drop it if it is not
297
 needed (e.g. "welcome" notes). Changing the templates type to "error"
298 299
 can also be appropriate, such as for input validation errors.
Ref: policy 3.9.1
300 301

Tag: select-with-boolean-choices
302 303
Severity: normal
Certainty: possible
304 305 306
Info: Select templates with only yes and no choices should use the boolean
 type instead.
Ref: debconf-devel(7)
307 308

Tag: template-uses-unsplit-choices
309 310
Severity: normal
Certainty: possible
311
Info: The use of _Choices in templates is deprecated.
312
 A _Choices field must be translated as a single string.
313 314 315 316 317 318 319 320 321 322
 .
 Using __Choices allows each choice to be translated separately, easing
 translation and is therefore recommended.
 .
 Instead of simply replacing all occurrences of "_Choices" by "__Choices",
 apply the method described in po-debconf(7) under "SPLITTING CHOICES
 LIST", to avoid breaking existing translations.
 .
 If in doubt, please ask for help on the debian-i18n mailing list.
Ref: po-debconf(7)
323 324

Tag: unused-debconf-template
325 326
Severity: minor
Certainty: possible
327 328 329 330 331 332
Info: Templates which are not used by the package should be removed from
 the templates file.
 .
 This will reduce the size of the templates database and prevent
 translators from unnecessarily translating the template's text.
 .
333
 In some cases, the template is used but Lintian is unable to determine
334
 this. Common causes are:
335
 .
336
 - the maintainer scripts embed a variable in the template name in
337
 order to allow a template to be selected from a range of similar
Russ Allbery's avatar
Russ Allbery committed
338
 templates (e.g. <tt>db_input low start_$service_at_boot</tt>)
339
 .
340
 - the template is not used by the maintainer scripts but is used by
341 342
 a program in the package
 .
343
 - the maintainer scripts are written in perl. Lintian currently only
344
 understands the shell script debconf functions.
345
 .
346
 If any of the above apply, please install an override.
347 348 349 350 351 352 353 354

Tag: syntax-error-in-debconf-template
Severity: important
Certainty: possible
Info: The template file contains a syntax error.
 .
 This issue may hide other issues as Lintian skips some checks on the
 file in this case.