lintian: r739 - in trunk: checks debian testset testset/debconf/debian
Author: rra
Date: 2006-09-04 21:03:38 +0200 (Mon, 04 Sep 2006)
New Revision: 739
Modified:
trunk/checks/debconf
trunk/checks/debconf.desc
trunk/debian/changelog
trunk/testset/debconf/debian/debconf-test.config
trunk/testset/debconf/debian/debconf-test.postinst
trunk/testset/tags.debconf
Log:
* checks/debconf{.desc,}:
+ [RA] Diagnose unknown priorities in db_input and db_text
invocations. Patch from Thomas Huriaux. (Closes: #386014)
Modified: trunk/checks/debconf
===================================================================
--- trunk/checks/debconf 2006-09-03 23:17:09 UTC (rev 738)
+++ trunk/checks/debconf 2006-09-04 19:03:38 UTC (rev 739)
@@ -30,7 +30,7 @@
my $pkg = shift;
my $type = shift;
-# From debconf-devel(7), section 'THE TEMPLATES FILE', uptodate with debconf
+# From debconf-devel(7), section 'THE TEMPLATES FILE', up to date with debconf
# version 1.3.22. Added indices for cdebconf (indicates sort order for
# choices); debconf doesn't support it, but it ignores it, which is safe
# behavior.
@@ -38,7 +38,7 @@
map { $template_fields{$_}=1 }
qw(template type choices indices default description);
-# From debconf-devel(7), section 'THE TEMPLATES FILE', uptodate with debconf
+# From debconf-devel(7), section 'THE TEMPLATES FILE', up to date with debconf
# version 1.3.22
my %valid_types;
map { $valid_types{$_}=1 } qw(
@@ -54,6 +54,11 @@
);
$valid_types{error} = 1 if $type eq 'udeb';
+# From debconf-devel(7), section 'THE DEBCONF PROTOCOL' under 'INPUT', up to
+# date with debconf version 1.5.3.
+my %valid_priorities = map { $_ => 1 }
+ qw(low medium high critical);
+
my $seenconfig='';
my $seentemplates='';
my $usespreinst='';
@@ -348,6 +353,11 @@
unless $type eq 'udeb';
$db_input=1;
}
+ if (m/^\s*(?:db_input|db_text)\s+[\"\']?(\S+?)[\"\']?\s+\S+\s/) {
+ my $priority = $1;
+ tag "unknown-debconf-priority", "$file:$. $1"
+ unless ($priority =~ /^\$\S+$/ || $valid_priorities{$priority});
+ }
if (not $isdefault and m/db_fset.*isdefault/) {
# TODO: Perl?
tag "isdefault-flag-is-deprecated", "$file";
Modified: trunk/checks/debconf.desc
===================================================================
--- trunk/checks/debconf.desc 2006-09-03 23:17:09 UTC (rev 738)
+++ trunk/checks/debconf.desc 2006-09-04 19:03:38 UTC (rev 739)
@@ -265,3 +265,10 @@
more than about 20 lines, so try to keep the extended description below
this limit.
Ref: devref 6.5.3.2
+
+Tag: unknown-debconf-priority
+Type: error
+Info: The given maintainer script calls db_input or or db_text with a
+ first argument that doesn't match one of the known priorities. The
+ supported priorities are low, medium, high, and critical.
+Ref: debconf-devel(7)
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2006-09-03 23:17:09 UTC (rev 738)
+++ trunk/debian/changelog 2006-09-04 19:03:38 UTC (rev 739)
@@ -9,6 +9,9 @@
source tarball. This isn't an error; those files contain metadata
that may be useful for people making modifications and it's quite
common to distribute them.
+ * checks/debconf{.desc,}:
+ + [RA] Diagnose unknown priorities in db_input and db_text
+ invocations. Patch from Thomas Huriaux. (Closes: #386014)
* checks/fields{.desc,}:
+ [RA] Depending on versioned variants of python-minimal is also an
error. Thanks, Adeodato Simó. (Closes: #384476)
@@ -32,7 +35,7 @@
+ [RA] Move perm2oct to here and improve recognition of s, S, t, and T
characters. Thanks to Justin B. Rye for patch. (Closes: #376119)
- -- Russ Allbery <rra@debian.org> Sun, 3 Sep 2006 16:16:25 -0700
+ -- Russ Allbery <rra@debian.org> Mon, 4 Sep 2006 12:03:16 -0700
lintian (1.23.23) unstable; urgency=low
Modified: trunk/testset/debconf/debian/debconf-test.config
===================================================================
--- trunk/testset/debconf/debian/debconf-test.config 2006-09-03 23:17:09 UTC (rev 738)
+++ trunk/testset/debconf/debian/debconf-test.config 2006-09-04 19:03:38 UTC (rev 739)
@@ -5,3 +5,15 @@
. /usr/share/debconf/confmodule
db_settitle "Funky lintian test"
+
+# Bad priorities.
+db_text LOW debconf/test
+db_input normal debconf/test
+
+# Valid priorities.
+db_text \
+high debconf/test
+foo=medium
+db_input $foo debconf/test
+db_input "$foo" debconf/test
+db_input 'medium' debconf/test
Modified: trunk/testset/debconf/debian/debconf-test.postinst
===================================================================
--- trunk/testset/debconf/debian/debconf-test.postinst 2006-09-03 23:17:09 UTC (rev 738)
+++ trunk/testset/debconf/debian/debconf-test.postinst 2006-09-04 19:03:38 UTC (rev 739)
@@ -4,4 +4,7 @@
. /usr/share/debconf/confmodule
+# Not supposed to do this here.
+db_input medium debconf/test
+
true
Modified: trunk/testset/tags.debconf
===================================================================
--- trunk/testset/tags.debconf 2006-09-03 23:17:09 UTC (rev 738)
+++ trunk/testset/tags.debconf 2006-09-04 19:03:38 UTC (rev 739)
@@ -5,6 +5,8 @@
E: debconf-test: mismatch-translated-choices debconf/testmulti choices-de.utf-8
E: debconf-test: no-template-description debconf/no-description
E: debconf-test: settitle-requires-versioned-depends config
+E: debconf-test: unknown-debconf-priority config:11 LOW
+E: debconf-test: unknown-debconf-priority config:12 normal
E: debconf-udeb udeb: udeb-postinst-must-not-call-ldconfig
W: debconf source: invalid-po-file debian/po/fr.po
W: debconf source: maintainer-script-lacks-debhelper-token debian/debconf-test.postinst
@@ -23,6 +25,7 @@
W: debconf-test: malformed-title-in-templates debconf/testnote
W: debconf-test: old-fsf-address-in-copyright-file
W: debconf-test: partially-translated-question debconf/testmulti de.utf-8
+W: debconf-test: postinst-uses-db-input
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
Reply to: