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

lintian: r937 - in trunk: checks debian testset testset/diffs testset/diffs/.bzr testset/diffs/.git



Author: rra
Date: 2007-08-01 06:48:59 +0200 (Wed, 01 Aug 2007)
New Revision: 937

Added:
   trunk/testset/diffs/.#binary.c.1.34
   trunk/testset/diffs/.bzr/
   trunk/testset/diffs/.bzr/dummy
   trunk/testset/diffs/.git/
   trunk/testset/diffs/.git/dummy
   trunk/testset/diffs/svn-commit.tmp
Removed:
   trunk/checks/debdiff
   trunk/checks/debdiff.desc
Modified:
   trunk/checks/cruft
   trunk/checks/cruft.desc
   trunk/debian/changelog
   trunk/testset/diffs_1.orig.tar.gz
   trunk/testset/tags.diffs
   trunk/testset/tags.filenames
Log:
  + [RA] Substantially rewrite how all cruft checking against source
    packages is done, incorporating debdiff in the process.  There are
    now two tags for most source package cruft problems: one for files
    introduced in the Debian diff or in a native package, and one for
    files present upstream.  The former is at warning severity and the
    latter is at info severity, since it's usually not worth repackaging
    the upstream source to remove such files.  In the process,
    standardize the names of all of the tags and pull the regexes out
    into data instead of code for easier maintenance.  (Closes: #434744)
* checks/debdiff{.desc}:
  + [RA] Removed, incorporated into checks/cruft.

Modified: trunk/checks/cruft
===================================================================
--- trunk/checks/cruft	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/checks/cruft	2007-08-01 04:48:59 UTC (rev 937)
@@ -4,6 +4,7 @@
 # Copyright (C) 1999 Joey Hess
 # Copyright (C) 2000 Sean 'Shaleh' Perry
 # Copyright (C) 2002 Josip Rodin
+# Copyright (C) 2007 Russ Allbery
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,8 +24,10 @@
 
 package Lintian::cruft;
 use strict;
+
 use Dep;
 use Tags;
+use Util;
 
 use Cwd;
 use File::Find;
@@ -36,6 +39,43 @@
     qw(autotools-dev automake automaken automake1.4 automake1.7 automake1.8
        automake1.9 automake1.10);
 
+# Directory checks.  These regexes match a directory that shouldn't be in the
+# source package and associate it with a tag (minus the leading
+# source-contains or diff-contains).  Note that only one of these regexes
+# should trigger for any single directory.
+my @directory_checks =
+    ([ qr,^(.+/)?CVS$,        => 'cvs-control-dir'  ],
+     [ qr,^(.+/)?\.svn$,      => 'svn-control-dir'  ],
+     [ qr,^(.+/)?\.bzr$,      => 'bzr-control-dir'  ],
+     [ qr,^(.+/)?\{arch\}$,   => 'arch-control-dir' ],
+     [ qr,^(.+/)?\.arch-ids$, => 'arch-control-dir' ],
+     [ qr!^(.+/)?,,.+$!       => 'arch-control-dir' ],
+     [ qr,^(.+/)?\.git$,      => 'git-control-dir'  ],
+    );
+
+# File checks.  These regexes match files that shouldn't be in the source
+# package and associate them with a tag (minus the leading source-contains or
+# diff-contains).  Note that only one of these regexes should trigger for any
+# given file.  If the third column is a true value, don't issue this tag
+# unless the file is included in the diff; it's too common in source packages
+# and not important enough to worry about.
+my @file_checks =
+    ([ qr,^(.+/)?svn-commit\.(.+\.)?tmp$, => 'svn-commit-file'        ],
+     [ qr,^(.+/)?svk-commit.+\.tmp$,      => 'svk-commit-file'        ],
+     [ qr,^(.+/)?\.arch-inventory$,       => 'arch-inventory-file'    ],
+     [ qr,^(.+/)?\.\#(.+?)\.\d+(\.\d+)*$, => 'cvs-conflict-copy'      ],
+     [ qr,^(.+/)?(.+?)\.(r\d+|mine)$,     => 'svn-conflict-file'      ],
+     [ qr,\.(orig|rej)$,                  => 'patch-failure-file',  1 ],
+     [ qr,((^|/)\.[^/]+\.swp|~)$,         => 'editor-backup-file',  1 ],
+    );
+
+# Records files warned about in the diff so that we don't warn about them
+# again in the source checks.
+my %warned;
+
+# Whether this is a native Debian package.
+my $native;
+
 my $dir;
 my $pkg;
 my $atdinbd;
@@ -45,17 +85,29 @@
 $pkg = shift;
 my $type = shift;
 
-unless ((not -e "debfiles/files") or (-z "debfiles/files")) {
-    tag "debian-files-list-in-source", "";
+if (-e "debfiles/files" and not -z "debfiles/files") {
+    tag 'debian-files-list-in-source';
 }
 
-# read architecture file and see if it's a doc package
+# This doens't really belong here, but there isn't a better place at the
+# moment to put this check.
+open (VERSION, "fields/version") or fail("cannot open fields/version: $!");
+chomp(my $version = <VERSION>);
+close VERSION;
+$version =~ s/^\d+://; #Remove epoch
+$native = (! -f "${pkg}_${version}.diff.gz");
+if ($native and $version =~ /-/ and $version !~ /-0\.[^-]+$/) {
+    tag 'native-package-with-dash-version';
+}
+
+# Check if this is a documentation package that's not arch: all.  This doesn't
+# really belong here either.
 my $arch;
 if (open IN, "fields/architecture") {
     chop($arch = <IN>);
     close IN;
     if ($pkg =~ /-docs?$/ && $arch ne 'all') {
-	tag "documentation-package-not-architecture-independent", "";
+        tag 'documentation-package-not-architecture-independent';
     }
 }
 
@@ -74,57 +126,100 @@
 my $cwd = cwd;
 $dir = readlink "$cwd/unpacked"; # File::Find in Perl 5.8 appears to need it
 
+check_diffstat("diffstat");
 find(\&find_cruft, "$dir");
 
 } # </run>
 
+# -----------------------------------
+
+# Check the diff for problems.  Record any files we warn about in %warned so
+# that we don't warn again when checking the full unpacked source.  Takes the
+# name of a file containing diffstat output.
+sub check_diffstat {
+    my ($diffstat) = @_;
+    open(STAT, $diffstat) or fail("cannot open $diffstat: $!");
+    local $_;
+    while (<STAT>) {
+        my ($file) = (m,^\s+(.*?)\s+\|,)
+            or fail("syntax error in diffstat file: $_");
+
+        # We only care about diffs that add files.  If the file is being
+        # modified, that's not a problem with the diff and we'll catch it
+        # later when we check the source.  This regex doesn't catch only file
+        # adds, just any diff that doesn't remove lines from a file, but it's
+        # a good guess.
+        next unless m,\|\s+\d+\s+\++$,;
+
+        # diffstat output contains only files, but we consider the directory
+        # checks to trigger if the diff adds any files in those directories.
+        my ($directory) = ($file =~ m,^(.*)/[^/]+$,);
+        if ($directory and not $warned{$directory}) {
+            for my $rule (@directory_checks) {
+                if ($directory =~ /$rule->[0]/) {
+                    tag "diff-contains-$rule->[1]", $directory;
+                    $warned{$directory} = 1;
+                }
+            }
+        }
+
+        # Now the simpler file checks.
+        for my $rule (@file_checks) {
+            if ($file =~ /$rule->[0]/) {
+                tag "diff-contains-$rule->[1]", $file;
+                $warned{$file} = 1;
+            }
+        }
+
+        # Additional special checks only for the diff, not the full source.
+        if ($file =~ m,^debian/substvars$,) {
+            tag 'diff-contains-substvars', $file;
+        }
+    }
+    close(STAT) or fail("error reading diffstat file: $!");
+}
+
+# Check each file in the source package for problems.  By the time we get to
+# this point, we've already checked the diff and warned about anything added
+# there, so we only warn about things that weren't in the diff here.
+#
+# Report problems with native packages using the "diff-contains" rather than
+# "source-contains" tag.  The tag isn't entirely accurate, but it's better
+# than creating yet a third set of tags, and this gets the severity right.
 sub find_cruft {
     (my $name = $File::Find::name) =~ s,^\Q$dir\E/,,;
-    if (-d) {
-	# More or less copied from files, but this time it checks the source
-	if ($name =~ m,^(.+/)?CVS$,) {
-	    tag "source-contains-CVS-dir", "$name";
-	} elsif ($name =~ m,^(.+/)?\.svn$,) {
-	    tag "source-contains-svn-control-dir", "$name";
-	} elsif ($name =~ m,^(.+/)?\.bzr$,) {
-	    tag "source-contains-bzr-control-dir", "$name";
-	} elsif ($name =~ m,^(.+/)?\{arch\}$,) {
-	    tag "source-contains-arch-control-dir", "$name";
-	} elsif ($name =~ m,^(.+/)?\.arch-ids$,) {
-	    tag "source-contains-arch-control-dir", "$name";
-	} elsif ($name =~ m,^(.+/)?\.git$,) {
-	    tag "source-contains-git-control-dir", "$name";
-	}
+    my $prefix = ($native ? "diff-contains" : "source-contains");
+    if (-d and not $warned{$name}) {
+        for my $rule (@directory_checks) {
+            if ($name =~ /$rule->[0]/) {
+                tag "${prefix}-$rule->[1]", $name;
+            }
+        }
     }
+    -f or return; # we just need normal files for the rest
 
-    -f or return; # we just need normal files, for now
-
-    # More or less copied from files, but this time it checks the source
-    if ($name =~ m,^(.+/)?svn-commit\.(.+\.)?tmp$,) {
-	tag "svn-commit-file-in-source", "$name";
-    } elsif ($name =~ m,^(.+/)?svk-commit.+\.tmp$,) {
-        tag "svk-commit-file-in-source", "$name";
-    } elsif ($name =~ m,^(.+/)?\.arch-inventory$,) {
-	tag "arch-inventory-file-in-source", "$name";
-    } elsif ($name =~ m,^(.+/)?\.\#(.+?)\.\d+(\.\d+)*$,) {
-	tag "source-contains-cvs-conflict-copy", "$name";
-    } elsif ($name =~ m,^(.+/)?(.+?)\.(r\d+|mine)$,) {
-	tag "source-contains-svn-conflict-copy", "$name";
+    unless ($warned{$name}) {
+        for my $rule (@file_checks) {
+            next if ($rule->[2] and not $native);
+            if ($name =~ /$rule->[0]/) {
+                tag "${prefix}-$rule->[1]", $name;
+            }
+        }
     }
 
+    # Tests of autotools files are a special case.
     if ($name =~ m,^(.+/)?config.(?:cache|log|status)$, and $pkg ne "lintian") {
-	tag "configure-generated-file-in-source", "$name";
+        tag "configure-generated-file-in-source", $name;
     } elsif ($name =~ m,^(.+/)?config.(?:guess|sub)$, and not $atdinbd) {
-	my $b = basename $name;
-	my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat $b;
-	open F, $b or die "can't open $name: $!";
-	while (<F>) {
+        my $b = basename $name;
+        open F, $b or die "can't open $name: $!";
+        while (<F>) {
             last if $. > 10; # it's on the 6th line, but be a bit more lenient
-	    if (/^(?:timestamp|version)='(\d+)(.+)'$/ and $1 < 2004) {
-		tag "outdated-autotools-helper-file", "$name $1$2";
-	    }
-	}
-	close F;
+            if (/^(?:timestamp|version)='(\d+)(.+)'$/ and $1 < 2004) {
+                tag "outdated-autotools-helper-file", $name, "$1$2";
+            }
+        }
+        close F;
     }
 }
 1;

Modified: trunk/checks/cruft.desc
===================================================================
--- trunk/checks/cruft.desc	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/checks/cruft.desc	2007-08-01 04:48:59 UTC (rev 937)
@@ -1,114 +1,234 @@
 Check-Script: cruft
 Author: Sean 'Shaleh' Perry <shaleh@debian.org>
 Abbrev: deb
-Standards-Version: 3.6.1
+Standards-Version: 3.7.2
 Type: source
 Unpack-Level: 2
-Info: This looks for cruft in Debian packaging
-Needs-Info: debfiles
+Info: This looks for cruft in Debian packaging or upstream source
+Needs-Info: debfiles, diffstat
 
-Tag: debian-files-list-in-source
-Type: error
-Info: Leaving <tt>debian/files</tt> causes problems for the autobuilders,
- since that file will likely include the list of .deb files for another
- architecture, which will cause dpkg-buildpackage run by the buildd to fail.
- .
- The clean rule for the package should remove this file.
-
-Tag: configure-generated-file-in-source
+Tag: native-package-with-dash-version
 Type: warning
-Info: Leaving config.cache/status causes autobuilders problems.
- config.cache and config.status are produced by GNU autoconf's configure
- scripts. If they are left in the source package, autobuilders may pick
- up settings for the wrong architecture.
+Info: Native packaging should only be used if a piece of software was
+ written specifically to be turned into a Debian package. In this case,
+ the version number should not contain a debian revision part.
  .
- The clean rule in <tt>debian/rules</tt> should remove this file. This
- should ideally be done by fixing the upstream build system to do it when
- you run the appropriate cleaning command (and don't forget to forward the
- fix to the upstream authors so it doesn't happen in the next release). If
- that is already implemented, then make sure you are indeed cleaning it in
- the clean rule. If all else fails, a simple rm -f should work.
- .
- Note that Lintian cannot reliably detect the removal in the clean rule,
- so once you fix this, please ignore or override this warning.
+ Native source packages are sometimes created by accident. In most cases
+ the reason is the location of the original source tarball. dpkg-source
+ searches for this in ../package_upstream-version.orig.tar.gz.
 
 Tag: documentation-package-not-architecture-independent
 Type: warning
 Info: Documentation packages usually shouldn't carry anything that requires
  recompiling on various architectures, in order to save space on mirrors.
 
-Tag: outdated-autotools-helper-file
+Tag: debian-files-list-in-source
 Type: error
-Info: The referenced file has a time stamp older than year 2004 and the
- package does not build-depend on autotools-dev or automake and therefore
- apparently does not update it. This usually means that the source package
- will not work correctly on all currently released architectures.
+Info: Leaving <tt>debian/files</tt> causes problems for the autobuilders,
+ since that file will likely include the list of .deb files for another
+ architecture, which will cause dpkg-buildpackage run by the buildd to fail.
+ .
+ The clean rule for the package should remove this file.
 
-Tag: svn-commit-file-in-source
+Tag: diff-contains-cvs-control-dir
 Type: warning
-Info: Package source contains a 'svn-commit(.NNN).tmp' file.  This file is
- almost certainly a left-over from a failed Subversion commit, and does not
- belong in a Debian package.
+Info: The Debian diff or native package contains files in a CVS directory.
+ These are usually artifacts of the revision control system used by the
+ Debian maintainer and not useful in a diff or native package.  Passing
+ <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
 
-Tag: svk-commit-file-in-source
+Tag: source-contains-cvs-control-dir
+Type: info
+Info: The upstream source contains a CVS directory.  It was most likely
+ included by accident since CVS directories usually don't belong in
+ releases.  When packaging a CVS snapshot, export from CVS rather than use
+ a checkout.  If an upstream release tarball contains CVS directories, you
+ usually should report this as a bug to upstream.
+
+Tag: diff-contains-svn-control-dir
 Type: warning
-Info: Package source contains a 'svk-commitNNN.tmp' file.  This file is
- almost certainly a left-over from a failed svk commit, and does not
- belong in a Debian package.
+Info: The Debian diff or native package contains files in an .svn
+ directory.  These are usually artifacts of the revision control system
+ used by the Debian maintainer and not useful in a diff or native package.
+ Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
 
-Tag: arch-inventory-file-in-source
+Tag: source-contains-svn-control-dir
 Type: info
-Info: Package contains a '.arch-inventory' file.  It may have been included by
- accident. It is Version Control System metadata that should not be
- distributed normally.
+Info: The upstream source contains an .svn directory.  It was most likely
+ included by accident since Subversion version control directories
+ usually don't belong in releases.  When packaging a Subversion snapshot,
+ export from subversion rather than checkout.  If an upstream release
+ tarball contains .svn directories, this should be reported as a bug to
+ upstream since it can double the size of the tarball to no purpose.
 
-Tag: source-contains-svn-control-dir
+Tag: diff-contains-bzr-control-dir
 Type: warning
-Info: Source contains a .svn directory. It was most likely included by
- accident, since Subversion version control directories usually don't belong
- in packages.  When packaging a Subversion snapshot, export from
- subversion rather than checkout.  If an upstream release tarball contains
- .svn directories, this should be reported as a bug to upstream since it
- can double the size of the tarball to no purpose.
+Info: The Debian diff or native package contains files in a .bzr
+ directory.  These are usually artifacts of the revision control system
+ used by the Debian maintainer and not useful in a diff or native package.
+ Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
 
 Tag: source-contains-bzr-control-dir
+Type: info
+Info: The upstream source contains a .bzr directory. It was most likely
+ included by accident since bazaar-ng version control directories usually
+ don't belong in releases and may contain the entire repository.  When
+ packaging a bzr snapshot, use bzr export to create a clean tree.  If an
+ upstream release tarball contains .bzr directories, you should usually
+ report this as a bug upstream.
+
+Tag: diff-contains-arch-control-dir
 Type: warning
-Info: Source contains a .bzr directory. It was most likely included by
- accident, since bazaar-ng version control directories usually don't belong
- in packages.
+Info: The Debian diff or native package contains files in an {arch} or
+ .arch-ids directory or a directory starting with <tt>,,</tt> (used by baz
+ for debugging traces).  These are usually artifacts of the revision
+ control system used by the Debian maintainer and not useful in a diff or
+ native package.  Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the
+ equivalent will automatically exclude them.
 
 Tag: source-contains-arch-control-dir
+Type: info
+Info: The upstream source contains an {arch} or .arch-ids directory or a
+ directory starting with <tt>,,</tt> (used by baz for debugging traces).
+ It was most likely included by accident since Arch version control
+ directories usually don't belong in releases.  If an upstream release
+ tarball contains these directories, you should usually report this as a
+ bug upstream.
+
+Tag: diff-contains-git-control-dir
 Type: warning
-Info: Source contains a {arch} or .arch-ids directory. It was most likely
- included by accident, since Arch version control directories usually don't
- belong in packages.
+Info: The Debian diff or native package contains files in a .git
+ directory.  These are usually artifacts of the revision control system
+ used by the Debian maintainer and not useful in a diff or native package.
+ Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
 
 Tag: source-contains-git-control-dir
+Type: info
+Info: The upstream source contains a .git directory. It was most likely
+ included by accident since git version control directories usually don't
+ belong in releases and may contain a complete copy of the repository.  If
+ an upstream release tarball contains .git directories, you should usually
+ report this as a bug upstream.
+
+Tag: diff-contains-svn-commit-file
 Type: warning
-Info: Source contains a .git directory.  It was most likely included by
- accident, since GIT version control directories usually don't belong in
- packages and may contain the entire GIT repository.
+Info: The Debian diff or native package contains an
+ <tt>svn-commit(.NNN).tmp</tt>, almost certainly a left-over from a failed
+ Subversion commit by the Debian package maintainer.
 
-Tag: source-contains-CVS-dir
+Tag: source-contains-svn-commit-file
 Type: info
-Info: Package contains a CVS directory.  It was most likely included by
- accident, since transient CVS data usually doesn't belong in packages.
- When packaging a CVS snapshot, export from CVS rather than use a
- checkout.  If an upstream release tarball contains CVS directories,
- you usually should report this as a bug to upstream.
+Info: The upstream source contains an <tt>svn-commit(.NNN).tmp</tt>,
+ almost certainly a left-over from a failed Subversion commit.  You may
+ want to report this as an upstream bug.
 
+Tag: diff-contains-svk-commit-file
+Type: warning
+Info: The Debian diff or native package contains an
+ <tt>svk-commitNNN.tmp</tt>, almost certainly a left-over from a failed
+ svk commit by the Debian package maintainer.
+
+Tag: source-contains-svk-commit-file
+Type: info
+Info: The upstream source contains an <tt>svk-commitNNN.tmp</tt>,
+ almost certainly a left-over from a failed Subversion commit.  You may
+ want to report this as an upstream bug.
+ 
+Tag: diff-contains-arch-inventory-file
+Type: warning
+Info: The Debian diff or native package contains an
+ <tt>.arch-inventory</tt> file.  This is Arch metadata that should
+ normally not be distributed.
+
+Tag: source-contains-arch-inventory-file
+Type: info
+Info: The upstream source contains an <tt>.arch-inventory</tt> file.  This
+ is Arch metadata that should normally not be distributed.  You may want
+ to report this as an upstream bug.
+
+Tag: diff-contains-cvs-conflict-copy
+Type: warning
+info: The Debian diff or native package contains a CVS conflict copy.
+ These have file names like <tt>.#file.version</tt> and are generated by
+ CVS when a conflict was detected when merging local changes with updates
+ from a source repository.  They're useful only while resolving the
+ conflict and should not be included in the package.
+
 Tag: source-contains-cvs-conflict-copy
+Type: info
+info: The upstream source contains a CVS conflict copy.  These have file
+ names like <tt>.#file.version</tt> and are generated by CVS when a
+ conflict was detected when merging local changes with updates from a
+ source repository.  They're useful only while resolving the conflict and
+ were probably included by accident.  You may want to report this as an
+ upstream bug.
+ 
+Tag: diff-contains-svn-conflict-file
 Type: warning
-Info: Package contains a CVS conflict copy. These are generated by CVS
- when a conflict was detected while merging local changes with the updates
- from the source repository. The file name is `.#file.version', where 
- file is the original filename and version the revision your modifications
- were based on.
+info: The Debian diff or native package contains a file that looks like a
+ Subversion conflict file.  These are generated by Subversion when a
+ conflict was detected while merging local changes with updates from a
+ source repository.  Use <tt>svn resolved</tt> to remove them and clear
+ the Subversion conflict state after you have resolved the conflict.
 
-Tag: source-contains-svn-conflict-copy
+Tag: source-contains-svn-conflict-file
+Type: info
+info: The upstream source contains a file that looks like a Subversion
+ conflict file.  These are generated by Subversion when a conflict was
+ detected while merging local changes with updates from a source
+ repository.  They're useful only while resolving the conflict and
+ were probably included by accident.  You may want to report this as an
+ upstream bug.
+
+Tag: diff-contains-patch-failure
 Type: warning
-Info: Package contains a Subversion conflict copy. These are generated by
- Subversion when a conflict was detected while merging local changes with the
- updates from the source repository. Use <tt>svn resolved</tt> to indicate you
- resolved the conflict, after you have manually checked and worked out the
- conflict.
+Info: The Debian diff or native package contains a file that looks like
+ the files left behind by the <tt>patch</tt> utility when it cannot
+ completely apply a diff.  This may be left over from a patch applied by
+ the maintainer.  Normally such files should not be included in the
+ package.
+
+Tag: diff-contains-editor-backup-file
+Type: info
+Info: The Debian diff or native package contains a file ending in
+ <tt>~</tt> or of the form <tt>.xxx.swp</tt>, which is normally either an
+ Emacs or vim backup file or a backup file created by programs such as
+ <tt>autoheader</tt> or <tt>debconf-updatepo</tt>.  This usually causes no
+ harm, but it's messy and bloats the size of the Debian diff to no useful
+ purpose.
+
+Tag: diff-contains-substvars
+Type: warning
+Info: Lintian found a substvars file in the Debian diff for this source 
+ package. The debian/substvars file is usually generated and modified
+ dynamically by debian/rules targets, in which case it must be removed by
+ the clean target.
+Ref: policy 4.9
+
+Tag: configure-generated-file-in-source
+Type: warning
+Info: Leaving config.cache/status causes autobuilders problems.
+ config.cache and config.status are produced by GNU autoconf's configure
+ scripts. If they are left in the source package, autobuilders may pick
+ up settings for the wrong architecture.
+ .
+ The clean rule in <tt>debian/rules</tt> should remove this file. This
+ should ideally be done by fixing the upstream build system to do it when
+ you run the appropriate cleaning command (and don't forget to forward the
+ fix to the upstream authors so it doesn't happen in the next release). If
+ that is already implemented, then make sure you are indeed cleaning it in
+ the clean rule. If all else fails, a simple rm -f should work.
+ .
+ Note that Lintian cannot reliably detect the removal in the clean rule,
+ so once you fix this, please ignore or override this warning.
+
+Tag: outdated-autotools-helper-file
+Type: error
+Info: The referenced file has a time stamp older than year 2004 and the
+ package does not build-depend on autotools-dev or automake and therefore
+ apparently does not update it. This usually means that the source package
+ will not work correctly on all currently released architectures.

Deleted: trunk/checks/debdiff
===================================================================
--- trunk/checks/debdiff	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/checks/debdiff	2007-08-01 04:48:59 UTC (rev 937)
@@ -1,59 +0,0 @@
-# debdiff -- Lintian check script -*- perl -*-
-
-# Copyright (C) 1998 Richard Braakman
-#
-# This program 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 program 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 program.  If not, you can find it on the World Wide
-# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
-# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-package Lintian::debdiff;
-use strict;
-use Tags;
-use Util;
-
-sub run {
-
-my $pkg = shift;
-my $type = shift;
-
-open (VERSION, "fields/version") or fail("cannot open fields/version: $!");
-chomp(my $version = <VERSION>);
-close VERSION;
-$version =~ s/^\d+://; #Remove epoch
-
-if ((not -f "${pkg}_${version}.diff.gz") and
-    ($version =~ /-/) and ($version !~ /-0\.[^-]+$/) ) {
-    tag("native-package-with-dash-version");
-}
-
-open(STAT, "diffstat") or fail("cannot open diffstat file: $!");
-
-while (<STAT>) {
-    my ($file) = (m/^\s+(.*?)\s+\|/)
-	or fail("syntax error in diffstat file: $_");
-
-    tag("patch-failure-file-in-diff", $file)
-	if ($file =~ m/\.(orig|rej)$/);
-    tag("editor-backup-file-in-diff", $file)
-	if ($file =~ m%((^|/)\.[^/]+\.swp|~)$% && /\|\s+\d+\s+\++$/);
-
-    tag("diff-contains-substvars", $file)
-	if ($file =~ m%^debian/substvars$%);
-}
-close(STAT) or fail("error reading diffstat file: $!");
-
-} # </run>
-
-1;

Deleted: trunk/checks/debdiff.desc
===================================================================
--- trunk/checks/debdiff.desc	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/checks/debdiff.desc	2007-08-01 04:48:59 UTC (rev 937)
@@ -1,42 +0,0 @@
-Check-Script: debdiff
-Author: Richard Braakman <dark@xs4all.nl>
-Abbrev: dif
-Standards-Version: 3.6.1
-Type: source
-Unpack-Level: 1
-Info: This script checks the diff to the original source tarball of a
- debian package
-Needs-Info: diffstat
-
-Tag: patch-failure-file-in-diff
-Type: warning
-Info: If the <tt>patch</tt> utility cannot completely apply a diff,
- it leaves certain files in the directory tree.  Lintian found such files
- in the Debian-diff for this source package.  This may indicate that the
- maintainer applied a patch that did not quite fit, and didn't notice.
-
-Tag: editor-backup-file-in-diff
-Type: info
-Info: The Debian diff contains a file ending in <tt>~</tt> or of the form
- <tt>.xxx.swp</tt>, which is normally either an Emacs or vim backup file
- or a backup file created by programs such as <tt>autoheader</tt> or
- <tt>debconf-updatepo</tt>.  This usually causes no harm, but it's messy
- and bloats the size of the Debian diff to no useful purpose.
-
-Tag: native-package-with-dash-version
-Type: warning
-Info: Native packaging should only be used if a piece of software was
- written specifically to be turned into a Debian package. In this case,
- the version number should not contain a debian revision part.
- .
- Native source packages are sometimes created by accident. In most cases
- the reason is the location of the original source tarball. dpkg-source
- searches for this in ../package_upstream-version.orig.tar.gz.
-
-Tag: diff-contains-substvars
-Type: warning
-Info: Lintian found a substvars file in the Debian diff for this source 
- package. The debian/substvars file is usually generated and modified
- dynamically by debian/rules targets, in which case it must be removed by
- the clean target.
-Ref: policy 4.9

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/debian/changelog	2007-08-01 04:48:59 UTC (rev 937)
@@ -6,11 +6,17 @@
   * checks/cruft{.desc,}:
     + [RA] Check for .git directories in source packages.  Thanks, Julien
       Cristau.  (Closes: #433516)
-    + [RA] Lower the severity of source-contains-CVS-dir to info, since
-      it's not worth repackaging upstream to fix this normally.  Thanks,
-      Thijs Kinkhorst.  (Closes: #434744)
-  * checks/debdiff:
-    + [RA] Replace all uses of tag_error and tag_warn with just tag.
+    + [RA] Substantially rewrite how all cruft checking against source
+      packages is done, incorporating debdiff in the process.  There are
+      now two tags for most source package cruft problems: one for files
+      introduced in the Debian diff or in a native package, and one for
+      files present upstream.  The former is at warning severity and the
+      latter is at info severity, since it's usually not worth repackaging
+      the upstream source to remove such files.  In the process,
+      standardize the names of all of the tags and pull the regexes out
+      into data instead of code for easier maintenance.  (Closes: #434744)
+  * checks/debdiff{.desc}:
+    + [RA] Removed, incorporated into checks/cruft.
   * checks/debian-readme:
     + [RA] Replace all uses of tag_error and tag_warn with just tag.
   * checks/files{.desc,}:
@@ -54,7 +60,7 @@
     + [RA] Replace any newlines in the extra information to the tag
       function with \n.
 
- --
+ -- Russ Allbery <rra@debian.org>  Tue, 31 Jul 2007 21:48:40 -0700
 
 lintian (1.23.32) unstable; urgency=low
 

Added: trunk/testset/diffs/.#binary.c.1.34
===================================================================
--- trunk/testset/diffs/.#binary.c.1.34	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/testset/diffs/.#binary.c.1.34	2007-08-01 04:48:59 UTC (rev 937)
@@ -0,0 +1 @@
+A CVS conflict copy to trigger the diff check.

Added: trunk/testset/diffs/.bzr/dummy
===================================================================
--- trunk/testset/diffs/.bzr/dummy	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/testset/diffs/.bzr/dummy	2007-08-01 04:48:59 UTC (rev 937)
@@ -0,0 +1 @@
+Some dummy file to trigger the .bzr in diff check.

Added: trunk/testset/diffs/.git/dummy
===================================================================
--- trunk/testset/diffs/.git/dummy	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/testset/diffs/.git/dummy	2007-08-01 04:48:59 UTC (rev 937)
@@ -0,0 +1,2 @@
+File contained in upstream source to trigger a warning and changed in
+the diff in a way that shouldn't trigger a diff warning.

Added: trunk/testset/diffs/svn-commit.tmp
===================================================================
--- trunk/testset/diffs/svn-commit.tmp	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/testset/diffs/svn-commit.tmp	2007-08-01 04:48:59 UTC (rev 937)
@@ -0,0 +1 @@
+Temporary file left over from failed upstream commit.

Modified: trunk/testset/diffs_1.orig.tar.gz
===================================================================
(Binary files differ)

Modified: trunk/testset/tags.diffs
===================================================================
--- trunk/testset/tags.diffs	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/testset/tags.diffs	2007-08-01 04:48:59 UTC (rev 937)
@@ -2,7 +2,9 @@
 E: diffs: arch-independent-package-contains-binary-or-object ./usr/bin/diffs
 E: diffs: no-copyright-file
 E: diffs: unstripped-binary-or-object ./usr/bin/diffs
-I: diffs source: editor-backup-file-in-diff binary.c~
+I: diffs source: diff-contains-editor-backup-file binary.c~
+I: diffs source: source-contains-git-control-dir .git
+I: diffs source: source-contains-svn-commit-file svn-commit.tmp
 I: diffs: no-md5sums-control-file
 W: diffs source: configure-generated-file-in-source config.cache
 W: diffs source: configure-generated-file-in-source config.log
@@ -13,6 +15,8 @@
 W: diffs source: configure-generated-file-in-source subdir-good/config.cache
 W: diffs source: configure-generated-file-in-source subdir-good/config.log
 W: diffs source: configure-generated-file-in-source subdir-good/config.status
+W: diffs source: diff-contains-bzr-control-dir .bzr
+W: diffs source: diff-contains-cvs-conflict-copy .#binary.c.1.34
 W: diffs source: diff-contains-substvars debian/substvars
 W: diffs source: out-of-date-standards-version 3.5.9 (current is 3.7.2)
 W: diffs: binary-without-manpage usr/bin/diffs

Modified: trunk/testset/tags.filenames
===================================================================
--- trunk/testset/tags.filenames	2007-08-01 00:57:32 UTC (rev 936)
+++ trunk/testset/tags.filenames	2007-08-01 04:48:59 UTC (rev 937)
@@ -26,20 +26,20 @@
 E: filenames: symlink-should-be-relative usr/lib/filenames/symlink3wrong /usr/lib/filenames/symlink2
 E: filenames: use-of-compat-symlink usr/bin/X11/
 E: filenames: use-of-compat-symlink usr/bin/X11/testxbin
-I: filenames source: arch-inventory-file-in-source files/.arch-inventory
-I: filenames source: source-contains-CVS-dir CVS
 I: filenames: file-in-usr-something-x11-without-pre-depends usr/include/X11/
 I: filenames: no-md5sums-control-file
 W: filenames source: ancient-standards-version 3.1.1 (current is 3.7.2)
-W: filenames source: source-contains-arch-control-dir .arch-ids
-W: filenames source: source-contains-arch-control-dir {arch}
-W: filenames source: source-contains-bzr-control-dir .bzr
-W: filenames source: source-contains-cvs-conflict-copy files/.#Maelstrom Sound.1.1.1
-W: filenames source: source-contains-svn-conflict-copy files/Maelstrom Sounce.r121
-W: filenames source: source-contains-svn-conflict-copy files/Maelstrom Sound.mine
-W: filenames source: source-contains-svn-control-dir .svn
-W: filenames source: svk-commit-file-in-source files/svk-commitsEr9P.tmp
-W: filenames source: svn-commit-file-in-source files/svn-commit.tmp
+W: filenames source: diff-contains-arch-control-dir .arch-ids
+W: filenames source: diff-contains-arch-control-dir {arch}
+W: filenames source: diff-contains-arch-inventory-file files/.arch-inventory
+W: filenames source: diff-contains-bzr-control-dir .bzr
+W: filenames source: diff-contains-cvs-conflict-copy files/.#Maelstrom Sound.1.1.1
+W: filenames source: diff-contains-cvs-control-dir CVS
+W: filenames source: diff-contains-svk-commit-file files/svk-commitsEr9P.tmp
+W: filenames source: diff-contains-svn-commit-file files/svn-commit.tmp
+W: filenames source: diff-contains-svn-conflict-file files/Maelstrom Sounce.r121
+W: filenames source: diff-contains-svn-conflict-file files/Maelstrom Sound.mine
+W: filenames source: diff-contains-svn-control-dir .svn
 W: filenames: arch-inventory-file-in-package files/.arch-inventory
 W: filenames: bad-permissions-for-ali-file usr/lib/ada/adalib/test.ali
 W: filenames: binary-without-manpage usr/X11R6/bin/testxbin2



Reply to: