lintian: r961 - in trunk: checks debian testset testset/debconf/debian
Author: rra
Date: 2007-10-15 03:38:31 +0200 (Mon, 15 Oct 2007)
New Revision: 961
Modified:
trunk/checks/debconf
trunk/checks/debconf.desc
trunk/debian/changelog
trunk/testset/debconf/debian/debconf-test.templates
trunk/testset/tags.debconf
Log:
+ [RA] Various improvements from Thomas Huriaux: Diagnose select
templates with only yes/no options, diagnose more question prompts,
warn on any questions in the extended description, allow yes/no
mentions in non-boolean templates, and catch more first-person
language. (Closes: #439508)
Modified: trunk/checks/debconf
===================================================================
--- trunk/checks/debconf 2007-10-15 01:12:31 UTC (rev 960)
+++ trunk/checks/debconf 2007-10-15 01:38:31 UTC (rev 961)
@@ -215,6 +215,9 @@
}
}
}
+ if ($template->{choices} =~ /^\s*(yes\s*,\s*no|no\s*,\s*yes)\s*$/i) {
+ tag "select-with-boolean-choices", "$template->{template}";
+ }
}
if ($isselect and not exists $template->{choices}) {
@@ -280,7 +283,7 @@
unless ($short =~ /for internal use/i) {
my $isprompt = grep { $_ eq $type } qw(string select password multiselect);
if ($isprompt) {
- if ($short && $short !~ m/:$/) {
+ if ($short && ($short !~ m/:$/ || $short =~ m/^(what|who|when|where|which|how)/i)) {
tag "malformed-prompt-in-templates", $template->{template};
}
if ($short =~ /^(Please|Cho+se|Enter|Select|Specify|Give)/) {
@@ -291,10 +294,10 @@
if ($short !~ /\?/) {
tag "malformed-question-in-templates", $template->{template};
}
- if (defined ($extended) && $extended =~ /\?/) {
- tag "using-question-in-extended-description-in-templates", $template->{template};
- }
}
+ if (defined ($extended) && $extended =~ /\?/) {
+ tag "using-question-in-extended-description-in-templates", $template->{template};
+ }
if ($type eq 'note') {
if ($short =~ /[.?;:]$/) {
tag "malformed-title-in-templates", $template->{template};
@@ -304,10 +307,10 @@
tag "too-long-short-description-in-templates", $template->{template};
}
if (defined $template->{description}) {
- if ($template->{description} =~ /(\A|\s)(I|[Mm]y|[Ww]e|[Oo]ur|[Oo]urs|mine|myself|ourself|me|us) /) {
+ if ($template->{description} =~ /(\A|\s)(I|[Mm]y|[Ww]e|[Oo]ur|[Oo]urs|mine|myself|ourself|me|us)(\Z|\s)/) {
tag "using-first-person-in-templates", $template->{template};
}
- if ($template->{description} =~ /[ \'\"]([Yy]es)[ \'\",.]/) {
+ if ($template->{description} =~ /[ \'\"](yes|no)[ \'\",;.]/i and $type eq 'boolean') {
tag "making-assumptions-about-interfaces-in-templates", $template->{template};
}
}
Modified: trunk/checks/debconf.desc
===================================================================
--- trunk/checks/debconf.desc 2007-10-15 01:12:31 UTC (rev 960)
+++ trunk/checks/debconf.desc 2007-10-15 01:38:31 UTC (rev 961)
@@ -218,12 +218,12 @@
Tag: using-question-in-extended-description-in-templates
Type: warning
-Info: The extended description of a boolean debconf template should not
- include a question.
+Info: The extended description of a debconf template should never include
+ a question.
.
If this template is only used internally by the package and not displayed
to the user, put "for internal use" in the short description.
-Ref: devref 6.5.4.2.2
+Ref: devref 6.5.3.2
Tag: using-imperative-form-in-templates
Type: warning
@@ -290,3 +290,9 @@
needed (e.g. "welcome" notes). Changing the templates type to "error"
can also be appropriate, such as for input validation errors.
Ref: policy 3.9.1
+
+Tag: select-with-boolean-choices
+Type: warning
+Info: Select templates with only yes and no choices should use the boolean
+ type instead.
+Ref: debconf-devel(7)
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-10-15 01:12:31 UTC (rev 960)
+++ trunk/debian/changelog 2007-10-15 01:38:31 UTC (rev 961)
@@ -13,6 +13,11 @@
+ [RA] A cdebconf that supported error was released with sarge, so
don't require a versioned cdebconf dependency. Thanks, Thijs
Kinkhorst. (Closes: #438860)
+ + [RA] Various improvements from Thomas Huriaux: Diagnose select
+ templates with only yes/no options, diagnose more question prompts,
+ warn on any questions in the extended description, allow yes/no
+ mentions in non-boolean templates, and catch more first-person
+ language. (Closes: #439508)
* checks/description{.desc,}:
+ [RA] Warn (at info level for now) about Homepage pseudo-fields in
the extended description. (Closes: #444336)
@@ -35,7 +40,7 @@
* collection/changelog-file{.desc,}:
+ [RA] Collect NEWS.Debian as well as changelog.
- -- Russ Allbery <rra@debian.org> Sun, 14 Oct 2007 18:12:22 -0700
+ -- Russ Allbery <rra@debian.org> Sun, 14 Oct 2007 18:38:07 -0700
lintian (1.23.34) unstable; urgency=low
Modified: trunk/testset/debconf/debian/debconf-test.templates
===================================================================
--- trunk/testset/debconf/debian/debconf-test.templates 2007-10-15 01:12:31 UTC (rev 960)
+++ trunk/testset/debconf/debian/debconf-test.templates 2007-10-15 01:38:31 UTC (rev 961)
@@ -87,3 +87,9 @@
Type: error
_Description: An error occurred
This is a sample Debconf error template.
+
+Template: debconf/should-be-boolean
+Type: select
+__Choices: yes, no
+_Description: Choose:
+ Pick yes or no.
Modified: trunk/testset/tags.debconf
===================================================================
--- trunk/testset/tags.debconf 2007-10-15 01:12:31 UTC (rev 960)
+++ trunk/testset/tags.debconf 2007-10-15 01:38:31 UTC (rev 961)
@@ -24,7 +24,6 @@
W: debconf-test-noscripts: postrm-does-not-purge-debconf
W: debconf-test-preinst: missing-debconf-dependency-for-preinst
W: debconf-test-preinst: old-fsf-address-in-copyright-file
-W: debconf-test: making-assumptions-about-interfaces-in-templates debconf/1st-person
W: debconf-test: making-assumptions-about-interfaces-in-templates debconf/testboolean
W: debconf-test: malformed-prompt-in-templates debconf/testmulti
W: debconf-test: malformed-prompt-in-templates debconf/teststring
@@ -36,9 +35,11 @@
W: debconf-test: possible-debconf-note-abuse config:19 debconf/test
W: debconf-test: possible-debconf-note-abuse postinst:8 debconf/test
W: debconf-test: postinst-uses-db-input
+W: debconf-test: select-with-boolean-choices debconf/should-be-boolean
W: debconf-test: too-long-extended-description-in-templates debconf/teststring
W: debconf-test: too-long-short-description-in-templates debconf/testnote
W: debconf-test: using-first-person-in-templates debconf/1st-person
W: debconf-test: using-imperative-form-in-templates debconf/1st-person
+W: debconf-test: using-imperative-form-in-templates debconf/should-be-boolean
W: debconf-test: using-question-in-extended-description-in-templates debconf/testboolean
W: debconf-udeb udeb: missing-debconf-dependency
Reply to: