[SCM] Debian package checker branch, master, updated. 2.2.12-31-ga5e53c2
The following commit has been merged in the master branch:
commit a5e53c20344412ce2a8bb14f7b4a6f32f4ee713a
Author: Russ Allbery <rra@debian.org>
Date: Sat Jul 4 22:40:36 2009 -0700
Update info checks for triggerized install-info
* checks/infofiles{,.desc}:
+ [RA] Remove all checking of maintainer scripts, since info dir
entries are now handled with triggers. Now always warn of info
files without INFO-DIR-SECTION, even if install-info were called
with a --section argument. Warn of info files without a DIR-ENTRY
section. Thanks, Raphaël Hertzog. (Closes: #534640)
+ [RA] Fix a bug in the detection of bad info file extensions that
missed extensions containing the string "info".
+ [RA] Improve the long descriptions of tags about compression of info
documents.
* checks/scripts{,.desc}:
+ [RA] Check for any maintainer script running install-info, since
this is now handled with triggers.
diff --git a/checks/infofiles b/checks/infofiles
index eef9119..cd12bc1 100644
--- a/checks/infofiles
+++ b/checks/infofiles
@@ -35,19 +35,8 @@ my $pkg = shift;
my $type = shift;
my $info = shift;
-my %preinst;
-my %postinst;
-my %prerm;
-my %postrm;
-
my %missing_section;
-# check maintainer scripts (for install-info invocation)
-check_script("preinst", \%preinst) if (-f "control/preinst");
-check_script("postinst", \%postinst) if (-f "control/postinst");
-check_script("prerm", \%prerm) if (-f "control/prerm");
-check_script("postrm", \%postrm) if (-f "control/postrm");
-
# Read package contents...
foreach my $file (sort keys %{$info->index}) {
my $index_info = $info->index->{$file};
@@ -84,7 +73,7 @@ foreach my $file (sort keys %{$info->index}) {
tag "info-document-not-compressed", "$file";
}
my $infoext = pop @fname_pieces;
- unless ($infoext && $infoext =~ /info(-\d)?/) { # it's not foo.info
+ unless ($infoext && $infoext =~ /^info(-\d)?$/) { # it's not foo.info
unless (!@fname_pieces) { # it's not foo{,-{1,2,3,...}}
tag "info-document-has-wrong-extension", "$file";
}
@@ -106,105 +95,22 @@ foreach my $file (sort keys %{$info->index}) {
local $_;
my ($section, $start, $end);
while (<INFO>) {
- $section = 1 if /INFO-DIR-SECTION\s+\S/;
+ $section = 1 if /^INFO-DIR-SECTION\s+\S/;
+ $start = 1 if /^START-INFO-DIR-ENTRY\b/;
+ $end = 1 if /^END-INFO-DIR-ENTRY\b/;
}
close INFO;
- $missing_section{$file} = 1 unless $section;
+ tag 'info-document-missing-dir-section', $file unless $section;
+ tag 'info-document-missing-dir-entry', $file unless $start && $end;
}
}
-# policy 13.2 says prerm and postinst
-if ($postrm{'calls-install-info'}) {
- tag "postrm-calls-install-info", "";
-}
-if ($preinst{'calls-install-info'}) {
- tag "preinst-calls-install-info", "";
-}
-
-if ($postinst{'calls-install-info'}) {
- tag "install-info-not-called-with-quiet-option", ""
- unless $postinst{'calls-install-info-quiet'};
-}
-if ($prerm{'calls-install-info'}) {
- # it must use the --quiet option
- tag "install-info-not-called-with-quiet-option", ""
- unless $prerm{'calls-install-info-quiet'};
-}
-
-# Currently we assume all the info pages are fine if any of them are installed
-# with an explicit --section option. It would be nice to be stricter.
-for my $file (keys %missing_section) {
- tag "info-document-missing-dir-section", "$file"
- unless ($postinst{'calls-install-info-section'});
-}
-
-# Ideally we'd check whether all documents installed are removed,
-# but for now we assume that if any are removed then they all are
-if ($postinst{'calls-install-info'}) {
- tag "info-documents-not-removed", ""
- unless ($prerm{'calls-install-info-remove'});
-}
-
-}
-
-# -----------------------------------
-
-sub check_script {
- my ($script,$pres) = @_;
- my ($no_check_menu,$no_check_installdocs);
- my $interp;
-
- open(IN, '<', "control/$script") or
- fail("cannot open maintainer script control/$script for reading: $!");
- $interp = <IN>;
- $interp = '' unless defined $interp;
- if ($interp =~ m,^\#\!\s*/bin/$known_shells_regex,) {
- $interp = 'sh';
- } elsif ($interp =~ m,^\#\!\s*/usr/bin/perl,) {
- $interp = 'perl';
- } else {
- if ($interp =~ m,^\#\!\s*(.+),) {
- $interp = $1;
- }
- else { # hmm, doesn't seem to start with #!
- # is it a binary? look for ELF header
- if ($interp =~ m/^\177ELF/) {
- return; # nothing to do here
- }
- $interp = 'unknown';
- }
- }
-
- my $hold;
- while (<IN>) {
- s/\s+#.*$//;
- # this wraps a previous line continuation into the current line
- if (defined $hold) {
- $_ = "$hold $_";
- $hold = undef;
- }
- # check if install-info is called and if so, is it called properly
- if (m/install-info/o) {
- if (m,\\$,) {
- $hold = substr($_, 0, -1);
- next;
- }
- $pres->{'calls-install-info'} = 1;
- my @pieces = split(/\s+/);
- for my $piece (@pieces) {
- if ($piece eq '--quiet') {
- $pres->{'calls-install-info-quiet'} = 1;
- } elsif ($piece eq '--section') {
- $pres->{'calls-install-info-section'} = 1;
- } elsif ($piece eq '--remove' or $piece eq '--remove-exactly') {
- $pres->{'calls-install-info-remove'} = 1;
- }
- }
- }
- }
- close IN;
}
1;
-# vim: syntax=perl
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8
diff --git a/checks/infofiles.desc b/checks/infofiles.desc
index d5a90f2..8aaa9e5 100644
--- a/checks/infofiles.desc
+++ b/checks/infofiles.desc
@@ -9,74 +9,55 @@ Info: This script checks if a binary package conforms to info document policy.
Tag: info-document-not-compressed
Severity: important
Certainty: certain
-Info: Info documents have to be installed compressed (using <tt>gzip -9</tt>).
+Info: Info documents should be compressed with <tt>gzip -9</tt>.
Ref: policy 12.2
Tag: info-document-not-compressed-with-gzip
Severity: important
Certainty: certain
-Info: Info documents should be compressed with <tt>gzip -9</tt>.
+Info: Info documents should be compressed with <tt>gzip -9</tt>. This
+ file ends in <tt>.gz</tt> but doesn't appear to be a gzip-compressed
+ file.
Ref: policy 12.2
Tag: info-document-not-compressed-with-max-compression
Severity: important
Certainty: certain
-Info: Info documents should be compressed with <tt>gzip -9</tt>.
+Info: Info documents should be compressed with <tt>gzip -9</tt>. This
+ file is compressed with gzip, but without using maximum compression.
Ref: policy 12.2
Tag: info-document-has-wrong-extension
Severity: normal
Certainty: certain
Info: The info document has an extension other than info*.gz.
-Ref: policy 12.2
Tag: info-document-missing-dir-section
-Severity: normal
+Severity: important
Certainty: certain
-Info: This info document has no INFO-DIR-SECTION line and no
- <tt>--section</tt> option is passed to <tt>install-info</tt> in the
- package <tt>postinst</tt> maintainer script. <tt>install-info</tt> will
- be unable to determine the section into which this info page should be
- put. The best solution is to add a line like:
+Info: This info document has no INFO-DIR-SECTION line.
+ <tt>install-info</tt> will be unable to determine the section into which
+ this info page should be put. The best solution is to add a line like:
.
@dircategory Development
.
to the texinfo source so that the generated info file will contain a
- section. See /usr/share/info/dir for sections to choose from.
- .
- Another alternative that doesn't require modifying the source is to
- explicitly pass a <tt>--section</tt> option to <tt>install-info</tt> in
- the <tt>postinst</tt> maintainer script, although in this case you will
- need to write the <tt>postinst</tt> yourself and not use tools like
- debhelper to do it for you.
-Ref: policy 12.2
-
-Tag: postrm-calls-install-info
-Severity: normal
-Certainty: certain
-Ref: policy 12.2
-Info: The postrm script calls the <tt>install-info</tt> command. Usually,
- this command should be called from the <tt>prerm</tt> maintainer script.
+ section. See <tt>/usr/share/info/dir</tt> for sections to choose from.
+ You will have to ensure that the build process builds new info files
+ rather than using ones built by upstream.
-Tag: preinst-calls-install-info
+Tag: info-document-missing-dir-entry
Severity: important
Certainty: certain
-Ref: policy 12.2
-Info: The preinst script calls the <tt>install-info</tt> command. Usually,
- this command should be called from the <tt>postinst</tt> maintainer script.
-
-Tag: install-info-not-called-with-quiet-option
-Severity: normal
-Certainty: certain
-Ref: policy 3.9
-Info: The package installation scripts should avoid producing output which it
- is unnecessary for the user to see. Policy specifically mentions install-info
- output as unnecessary.
-
-Tag: info-documents-not-removed
-Severity: normal
-Certainty: certain
-Ref: policy 12.2
-Info: The postinst script calls the <tt>install-info</tt> command, but the
- documents installed are not then removed by the <tt>prerm</tt> maintainer
- script.
+Info: This info document has no directory entry. This is text between
+ START-INFO-DIR-ENTRY and END-INFO-DIR-ENTRY lines which is copied into
+ the <tt>dir</tt> file in <tt>/usr/share/info</tt> by
+ <tt>install-info</tt>. The best solution is to add lines like:
+ .
+ @direntry
+ foo: (foo). Foo creator and editor
+ @end direntry
+ .
+ to the texinfo source so that the generated info file will contain an
+ appropriate entry. You will have to ensure that the build process builds
+ new info files rather than using ones built by upstream.
diff --git a/checks/scripts b/checks/scripts
index 1da05ad..7fed856 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -876,6 +876,9 @@ while (<SCRIPTS>) {
if (m,\binstall-sgmlcatalog\b, && !(m,--remove, && ($file eq 'prerm' || $file eq 'postinst'))) {
tag "install-sgmlcatalog-deprecated", "$file:$.";
}
+ if (m,\binstall-info\b,) {
+ tag 'install-info-used-in-maintainer-script', "$file:$.";
+ }
if (m,/var/lib/dpkg/status\b, && $pkg ne 'base-files' && $pkg ne 'dpkg') {
tag "maintainer-script-uses-dpkg-status-directly", "$file";
}
diff --git a/checks/scripts.desc b/checks/scripts.desc
index 68687d8..3f07dde 100644
--- a/checks/scripts.desc
+++ b/checks/scripts.desc
@@ -456,6 +456,17 @@ Info: This script apparently runs fc-cache. Updating of the fontconfig
cache files is now handled automatically by triggers, so running fc-cache
from maintainer scripts is no longer necessary.
+Tag: install-info-used-in-maintainer-script
+Severity: normal
+Certainty: possible
+Info: This script apparently runs <tt>install-info</tt>. Updating the
+ <tt>/usr/share/info/dir</tt> file is now handled automatically by
+ triggers, so running <tt>install-info</tt> from maintainer scripts is no
+ longer necessary.
+ .
+ If debhelper generated the maintainer script fragment, rebuilding the
+ package with debhelper 7.2.17 or later will fix this problem.
+
Tag: maintainer-script-uses-dpkg-status-directly
Severity: important
Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index 3dcda0c..c3f5b88 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,9 +2,14 @@ lintian (2.2.13) UNRELEASED; urgency=low
* Summary of tag changes:
+ Added:
+ - install-info-used-in-maintainer-script
- package-contains-info-dir-file
+ Removed:
+ - info-documents-not-removed
+ - install-info-not-called-with-quiet-option
- missing-comma-after-substvar
+ - postrm-calls-install-info
+ - preinst-calls-install-info
* checks/control-file{,.desc}:
+ [RA] Rework missing-separator-between-lines to only include two
@@ -29,9 +34,18 @@ lintian (2.2.13) UNRELEASED; urgency=low
2.6 and later. Thanks, Julian Andres Klode. (Closes: #534212)
+ [RA] Check for /usr/share/info/dir files included in the package.
Thanks, Bas Zoetekouw. (Closes: #535566)
- * checks/infofiles:
+ * checks/infofiles{,.desc}:
+ [RA] Ignore dir files; they're a different error that's now caught
by checks/files.
+ + [RA] Remove all checking of maintainer scripts, since info dir
+ entries are now handled with triggers. Now always warn of info
+ files without INFO-DIR-SECTION, even if install-info were called
+ with a --section argument. Warn of info files without a DIR-ENTRY
+ section. Thanks, Raphaël Hertzog. (Closes: #534640)
+ + [RA] Fix a bug in the detection of bad info file extensions that
+ missed extensions containing the string "info".
+ + [RA] Improve the long descriptions of tags about compression of info
+ documents.
* checks/init.d:
+ [RA] Take into account dangling symlinks in /etc/init.d. Patch from
Raphael Geissert. (Closes: #534139)
@@ -56,6 +70,8 @@ lintian (2.2.13) UNRELEASED; urgency=low
+ [RA] Avoid a false positive in the bashism check for trap with
signal numbers when the the trap command contains a number. Thanks,
Julien Cristau. (Closes: #534580)
+ + [RA] Check for any maintainer script running install-info, since
+ this is now handled with triggers.
* collection/strings:
+ [ADB] Handle the fact that, when Lintian is run as root, the output of
diff --git a/t/COVERAGE b/t/COVERAGE
index 5c50121..d1b5c15 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,4 +1,4 @@
-Last generated 2009-07-01
+Last generated 2009-07-05
The following tags are not tested by the test suite:
@@ -117,9 +117,6 @@ files special-file
files third-party-package-in-python-dir
files udeb-contains-documentation-file
-infofiles postrm-calls-install-info
-infofiles preinst-calls-install-info
-
init.d duplicate-updaterc.d-calls-in-postinst
init.d file-in-etc-rc.d-marked-as-conffile
init.d init.d-script-has-bad-start-runlevel
@@ -420,14 +417,6 @@ files wrong-file-owner-uid-or-gid
huge-usr-share arch-dep-package-has-big-usr-share
-infofiles info-document-has-wrong-extension
-infofiles info-document-missing-dir-section
-infofiles info-document-not-compressed
-infofiles info-document-not-compressed-with-gzip
-infofiles info-document-not-compressed-with-max-compression
-infofiles info-documents-not-removed
-infofiles install-info-not-called-with-quiet-option
-
init.d duplicate-updaterc.d-calls-in-postrm
init.d init-d-script-stops-in-s-runlevel
init.d init.d-script-has-bad-lsb-line
@@ -537,7 +526,6 @@ scripts maintainer-script-ignores-errors
scripts maintainer-script-removes-device-files
scripts maintainer-shell-script-fails-syntax-check
scripts php-script-but-no-phpX-cli-dep
-scripts possible-bashism-in-maintainer-script
scripts python-script-but-no-python-dep
scripts script-not-executable
scripts script-uses-bin-env
diff --git a/t/tests/infofiles-general/debian/bar.info b/t/tests/infofiles-general/debian/bar.info
new file mode 100644
index 0000000..ed0919c
--- /dev/null
+++ b/t/tests/infofiles-general/debian/bar.info
@@ -0,0 +1,2 @@
+This is bar.info, produced by hand from thin air, without the required
+directory bits.
diff --git a/t/tests/infofiles-general/debian/debian/rules b/t/tests/infofiles-general/debian/debian/rules
new file mode 100755
index 0000000..e4d4f48
--- /dev/null
+++ b/t/tests/infofiles-general/debian/debian/rules
@@ -0,0 +1,24 @@
+#!/usr/bin/make -f
+
+tmp = $(CURDIR)/debian/$(shell dh_listpackages)
+
+%:
+ dh $@
+
+override_dh_auto_install:
+ install -d $(tmp)/usr/share/info
+ install -m 644 foo.info $(tmp)/usr/share/info/foo.info
+ gzip -9 $(tmp)/usr/share/info/foo.info
+ install -m 644 foo.info $(tmp)/usr/share/info/foo
+ install -m 644 foo.info $(tmp)/usr/share/info/foo-nogz.gz
+ install -m 644 foo.info $(tmp)/usr/share/info/foo-nomax
+ gzip -1 $(tmp)/usr/share/info/foo-nomax
+ install -m 644 bar.info $(tmp)/usr/share/info/bar.info
+ gzip -9 $(tmp)/usr/share/info/bar.info
+ install -m 644 bar.info $(tmp)/usr/share/info/bar.newinfo
+ gzip -9 $(tmp)/usr/share/info/bar.newinfo
+
+override_dh_installinfo:
+
+override_dh_compress:
+ gzip -9 $(tmp)/usr/share/doc/infofiles-general/changelog
diff --git a/t/tests/manpages-general/debian/foo.info b/t/tests/infofiles-general/debian/foo.info
similarity index 100%
copy from t/tests/manpages-general/debian/foo.info
copy to t/tests/infofiles-general/debian/foo.info
diff --git a/t/tests/infofiles-general/desc b/t/tests/infofiles-general/desc
new file mode 100644
index 0000000..69b01f6
--- /dev/null
+++ b/t/tests/infofiles-general/desc
@@ -0,0 +1,12 @@
+Testname: infofiles-general
+Sequence: 6000
+Version: 1.0
+Description: Checks of info files
+Test-For:
+ info-document-has-wrong-extension
+ info-document-missing-dir-entry
+ info-document-missing-dir-section
+ info-document-not-compressed
+ info-document-not-compressed-with-gzip
+ info-document-not-compressed-with-max-compression
+References: Bug#534640
diff --git a/t/tests/infofiles-general/tags b/t/tests/infofiles-general/tags
new file mode 100644
index 0000000..96a28fc
--- /dev/null
+++ b/t/tests/infofiles-general/tags
@@ -0,0 +1,9 @@
+E: infofiles-general: info-document-missing-dir-entry usr/share/info/bar.info.gz
+E: infofiles-general: info-document-missing-dir-entry usr/share/info/bar.newinfo.gz
+E: infofiles-general: info-document-missing-dir-section usr/share/info/bar.info.gz
+E: infofiles-general: info-document-missing-dir-section usr/share/info/bar.newinfo.gz
+E: infofiles-general: info-document-not-compressed usr/share/info/foo
+E: infofiles-general: info-document-not-compressed-with-gzip usr/share/info/foo-nogz.gz
+E: infofiles-general: info-document-not-compressed-with-max-compression usr/share/info/foo-nomax.gz
+W: infofiles-general: gz-file-not-gzip usr/share/info/foo-nogz.gz
+W: infofiles-general: info-document-has-wrong-extension usr/share/info/bar.newinfo.gz
diff --git a/t/tests/scripts-maintainer-general/debian/debian/postinst b/t/tests/scripts-maintainer-general/debian/debian/postinst
index 998753e..8051768 100755
--- a/t/tests/scripts-maintainer-general/debian/debian/postinst
+++ b/t/tests/scripts-maintainer-general/debian/debian/postinst
@@ -2,7 +2,7 @@
# This file contains a pile of random junk in maintainer scripts that we
# should be checking for in checks/scripts. Don't put bashisms in this file,
-# though; those should go into their own check.
+# though; those should go into scripts-bashisms.
set -e
@@ -100,4 +100,8 @@ EOF
# Obsolete suidregister program.
suidregister /usr/bin/foo
+# install-info is now handled through triggers.
+install-info --quiet --section Development Development \
+ /usr/share/info/foobar.info
+
#DEBHELPER#
diff --git a/t/tests/scripts-maintainer-general/desc b/t/tests/scripts-maintainer-general/desc
index b422b88..a106a2c 100644
--- a/t/tests/scripts-maintainer-general/desc
+++ b/t/tests/scripts-maintainer-general/desc
@@ -9,6 +9,7 @@ Test-For:
deprecated-chown-usage
fc-cache-used-in-maintainer-script
gconftool-used-in-maintainer-script
+ install-info-used-in-maintainer-script
install-sgmlcatalog-deprecated
maintainer-script-hides-init-failure
maintainer-script-modifies-inetd-conf
diff --git a/t/tests/scripts-maintainer-general/tags b/t/tests/scripts-maintainer-general/tags
index d61310f..8b36e22 100644
--- a/t/tests/scripts-maintainer-general/tags
+++ b/t/tests/scripts-maintainer-general/tags
@@ -12,6 +12,7 @@ W: scripts-maintainer-general: deprecated-chown-usage postinst:14 'chown root.ro
W: scripts-maintainer-general: deprecated-chown-usage postinst:84 'chown -R root.root'
W: scripts-maintainer-general: fc-cache-used-in-maintainer-script postinst:95
W: scripts-maintainer-general: gconftool-used-in-maintainer-script postinst:44
+W: scripts-maintainer-general: install-info-used-in-maintainer-script postinst:105
W: scripts-maintainer-general: maintainer-script-hides-init-failure postinst:31
W: scripts-maintainer-general: maintainer-script-needs-depends-on-gconf2 postinst
W: scripts-maintainer-general: maintainer-script-needs-depends-on-ucf postinst
diff --git a/testset/tags.maintainer-scripts b/testset/tags.maintainer-scripts
index e379149..c45462d 100644
--- a/testset/tags.maintainer-scripts
+++ b/testset/tags.maintainer-scripts
@@ -57,8 +57,8 @@ W: maintainer-scripts: config-does-not-load-confmodule
W: maintainer-scripts: deprecated-chown-usage postinst:167 'chown -R root.root'
W: maintainer-scripts: deprecated-chown-usage postinst:35 'chown root.root'
W: maintainer-scripts: gconftool-used-in-maintainer-script postinst:70
-W: maintainer-scripts: info-documents-not-removed
W: maintainer-scripts: init.d-script-not-marked-as-conffile /etc/init.d/foo
+W: maintainer-scripts: install-info-used-in-maintainer-script postinst:28
W: maintainer-scripts: maintainer-script-calls-deprecated-wm-menu-config postinst:33
W: maintainer-scripts: maintainer-script-empty config
W: maintainer-scripts: maintainer-script-hides-init-failure postinst:57
diff --git a/testset/tags.manpages b/testset/tags.manpages
index 02bfb06..312974c 100644
--- a/testset/tags.manpages
+++ b/testset/tags.manpages
@@ -7,6 +7,8 @@ E: manpages: empty-manual-page usr/share/man/man1/usr-bin-binary.1
E: manpages: empty-manual-page usr/share/man/man1/usr-sbin-binary.1.gz
E: manpages: empty-manual-page usr/share/man/man6/usr-games-binary.6.gz
E: manpages: executable-manpage usr/share/man/de/man1/binary-without-english-manpage.1
+E: manpages: info-document-missing-dir-entry usr/share/info/bar.gz
+E: manpages: info-document-missing-dir-section usr/share/info/bar.gz
E: manpages: info-document-not-compressed usr/share/info/broken
E: manpages: info-document-not-compressed-with-gzip usr/share/info/baz.broken.gz
E: manpages: info-document-not-compressed-with-max-compression usr/share/info/bar.gz
@@ -56,9 +58,8 @@ W: manpages: gz-file-not-gzip usr/share/info/baz.broken.gz
W: manpages: gz-file-not-gzip usr/share/man/man1/usr-bin-binary-alt.1.gz
W: manpages: gz-file-not-gzip usr/share/man/man1/usr-sbin-binary.1.gz
W: manpages: info-document-has-wrong-extension usr/share/info/baz.broken.gz
-W: manpages: info-document-missing-dir-section usr/share/info/bar.gz
-W: manpages: info-documents-not-removed
-W: manpages: install-info-not-called-with-quiet-option
+W: manpages: install-info-used-in-maintainer-script postinst:3
+W: manpages: install-info-used-in-maintainer-script postinst:4
W: manpages: link-to-undocumented-manpage usr/share/man/man1/bin-binary.1.gz
W: manpages: link-to-undocumented-manpage usr/share/man/man3/function.3.gz
W: manpages: manpage-has-bad-whatis-entry usr/X11R6/man/man1/rstartd.1x.gz
--
Debian package checker
Reply to: