[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.2.9-52-g288a108



The following commit has been merged in the master branch:
commit 288a10858c535f72b72ad43912be06304ff0a891
Author: Russ Allbery <rra@debian.org>
Date:   Mon Apr 27 17:22:05 2009 -0700

    Check all described tags are implemented
    
    Add a test that all tags with descriptions in checks/*.desc are issued
    somewhere in the code, with a whitelist of tags issued in ways that the
    checking script cannot figure out.  Based on work by Raphael Geissert.
    
    Also remove the descriptions for some unimplemented tags:
    
    * checks/files{,.desc}
      + [RA] Remove desc for removed possible-name-space-pollution tag.
    * checks/manpages.desc:
      + [RA] Remove desc for removed no-manpage-in-correct-directory tag.
    * checks/menu-format{,.desc}:
      + [RA] Remove desc for removed menu-item-adds-to-root-menu tag.

diff --git a/checks/files.desc b/checks/files.desc
index 6d3d8dd..e914d34 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -185,15 +185,6 @@ Info: The package installs a directory in <tt>/usr/local/...</tt> which is
  <tt>/usr/local</tt> is mounted read-only).
 Ref: policy 9.1.2
 
-Tag: possible-name-space-pollution
-Severity: normal
-Certainty: certain
-Info: The package installs a binary which uses a very short file name (one
- or two characters). This is not forbidden by policy, but short names
- should be reserved for the user.  Unless this short name has been used
- for a while already (like the famous "ls", "rm", "cp" commands), you
- should consider giving these binaries a longer name.
-
 Tag: non-standard-dir-perm
 Severity: normal
 Certainty: possible
diff --git a/checks/manpages.desc b/checks/manpages.desc
index 600487f..95ea483 100644
--- a/checks/manpages.desc
+++ b/checks/manpages.desc
@@ -200,17 +200,6 @@ Info: Manual pages for binaries that are not located in <tt>/usr/X11R6/bin</tt>
  proper solution for this problem; move the manual page instead.
 Ref: fhs usrsharemanmanualpages
 
-Tag: no-manpage-in-correct-directory
-Severity: normal
-Certainty: certain
-Info: Manpages for executables in /sbin and /usr/sbin should be placed in
- section 8; manpages for executables in /bin and /usr/bin in section 1;
- manpages for executables in /usr/games in section 6. For the noted
- executable some probable manpages were found but none in the right section.
- .
- This could either mean there is no manpage for the executable or that its
- manpage is placed in the wrong section.
-
 Tag: bad-so-link-within-manual-page
 Severity: important
 Certainty: certain
diff --git a/checks/menu-format.desc b/checks/menu-format.desc
index c5578f4..ae5db97 100644
--- a/checks/menu-format.desc
+++ b/checks/menu-format.desc
@@ -86,14 +86,6 @@ Info: The menu item has a line that has a needs= field with a strange value.
  This may be intentional, but it's probably a typo that will make menu
  ignore the line.
 
-Tag: menu-item-adds-to-root-menu
-Severity: important
-Certainty: certain
-Info: The menu item has a line that specifies a section that will put a menu
- item right in the root menu. Packages should never add items directly to the
- root menu. Note that if you specify an empty section, this error will
- pop up, as it will if you specify a section of "/".
-
 Tag: menu-item-uses-apps-games-section
 Severity: normal
 Certainty: certain
diff --git a/debian/changelog b/debian/changelog
index 4bfb25f..edd5f33 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,13 +38,17 @@ lintian (2.2.10) UNRELEASED; urgency=low
     + [RA] Remove package-uses-breaks.  dpkg in stable now supports it.
       Thanks, Julian Andres Klode.  (Closes: #522660)
     + [RA] Fix Needs-Info.  Thanks, Raphael Geissert.
-  * checks/files:
+  * checks/files{,.desc}
     + [ADB] Anchor the regular expression for the "gz-file-not-gzip" tag so
       that files with names that contain ".gz" but do not end in that string
       are not flagged.  Patch by Raphael Geissert.  (Closes: #523352)
+    + [RA] Remove desc for removed possible-name-space-pollution tag.
+  * checks/manpages.desc:
+    + [RA] Remove desc for removed no-manpage-in-correct-directory tag.
   * checks/menu-format{,.desc}:
     + [RA] Remove desktop-mimetype-without-update-call.  This is now
       handled by triggers.  Thanks, Chow Loong Jin.  (Closes: #525133)
+    + [RA] Remove desc for removed menu-item-adds-to-root-menu tag.
   * checks/patch-systems.desc:
     + [RA] Mention that empty dpatch patch lists or quilt series files
       will disappear in a non-native source package and hence produce the
diff --git a/t/scripts/implemented-tags.t b/t/scripts/implemented-tags.t
new file mode 100755
index 0000000..43343e1
--- /dev/null
+++ b/t/scripts/implemented-tags.t
@@ -0,0 +1,69 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2009 by Raphael Geissert <atomo64@gmail.com>
+# Copyright (C) 2009 Russ Allbery <rra@debian.org>
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict;
+
+use Test::More;
+use Util qw(read_dpkg_control slurp_entire_file);
+
+# Exclude the following tags, which are handled specially and can't be
+# detected by this script.
+our $EXCLUDE =
+    join('|', qw(.*-script-but-no-.*-dep$
+                 .*-contains-.*-control-dir$
+                 ^maintainer-script-needs-depends-on.*
+                 .*-contains-.*-file$
+                 .*-contains-cvs-conflict-copy$
+                 .*-does-not-load-confmodule$
+                 .*-name-missing$
+                 .*-address-missing$
+                 .*-address-malformed$
+                 .*-not-full-name$
+                 .*-address-looks-weird$
+                 .*-address-is-on-localhost$
+                 ^wrong-debian-qa-address-set-as-maintainer$
+                 ^wrong-debian-qa-group-name$
+                ));
+
+# Find all of the check description files.  We'll do one check per
+# description.
+our @DESCS = (<$ENV{LINTIAN_ROOT}/checks/*.desc>);
+plan tests => scalar(@DESCS);
+
+# For each desc file, build a list of tags and then scan the corresponding
+# source code looking for use of that tag.  The scanning is fairly
+# simple-minded.
+for my $desc (@DESCS) {
+    my @tags = map { $_->{tag} || () } read_dpkg_control($desc);
+    @tags = grep { !/$EXCLUDE/o } @tags;
+    my $file;
+    if ($desc =~ m,/lintian\.desc$,) {
+        $file = "$ENV{LINTIAN_ROOT}/frontend/lintian";
+    } else {
+        $file = $desc;
+        $file =~ s,\.desc$,,;
+    }
+    my $code = slurp_entire_file($file);
+    my @missing;
+    for my $tag (@tags) {
+        push(@missing, $tag) unless $code =~ /\Q$tag/;
+    }
+    my $short = $desc;
+    $short =~ s,^\Q$ENV{LINTIAN_ROOT}/*,,;
+    is(join(', ', @missing), '', "$short has all tags implemented");
+}

-- 
Debian package checker


Reply to: