Author: he
Date: 2008-03-03 11:48:59 +0100 (Mon, 03 Mar 2008)
New Revision: 1238

Added:
   trunk/testset/diffs/debian/patches/
   trunk/testset/diffs/debian/patches/00list
Modified:
   trunk/checks/patch-systems
   trunk/checks/patch-systems.desc
   trunk/debian/changelog
   trunk/testset/diffs/debian/control
   trunk/testset/tags.diffs
Log:
* check/patch-systems:
  + [HE] Warn if the .diff.gz contains changes while the package uses
    a patch system. (Closes: #452215)

Modified: trunk/checks/patch-systems
===================================================================
--- trunk/checks/patch-systems  2008-03-03 06:03:37 UTC (rev 1237)
+++ trunk/checks/patch-systems  2008-03-03 10:48:59 UTC (rev 1238)
@@ -33,6 +33,9 @@
        fail("directory in lintian laboratory for $type package $pkg missing: 
fields");
        }
 
+       #Some (cruft) checks are valid for every patch system, so we need to 
record that:
+       my $uses_patch_system = 0;
+
        #Get build deps so we can decide which build system the maintainer
        #meant to use:
        my $build_deps = "";
@@ -50,6 +53,7 @@
 
        #----- dpatch
        if (Dep::implies($build_deps, Dep::parse("dpatch"))) {
+               $uses_patch_system++;
                #check for a debian/patches file:
                if (! -r "debfiles/patches/00list") {
                        tag "dpatch-build-dep-but-no-patch-list", $pkg;
@@ -86,6 +90,24 @@
                        }
                }
        }
+
+       #----- general cruft checking:
+       if ($uses_patch_system) {
+               if ($uses_patch_system > 1) {
+                       #probably a bug too use more than one system, but we 
don't check anything but dpatch at the moment
+               }
+
+               open(STAT, '<', "diffstat") or fail("cannot open diffstat file: 
$!");
+               while (<STAT>) {
+                       my ($file) = (m,^\s+(.*?)\s+\|,)
+                            or fail("syntax error in diffstat file: $_");
+
+                       if ($file !~ /^debian/) {
+                               tag "patch-system-but-direct-changes-in-diff", 
$file;
+                       }
+               }
+               close (STAT) or fail("error reading diffstat file: $!");
+       }
 }
 
 1;

Modified: trunk/checks/patch-systems.desc
===================================================================
--- trunk/checks/patch-systems.desc     2008-03-03 06:03:37 UTC (rev 1237)
+++ trunk/checks/patch-systems.desc     2008-03-03 10:48:59 UTC (rev 1238)
@@ -26,3 +26,7 @@
 Info: dpatch files should carry a description of the function of the included
  patch. Description lines start with "## DP:".
 
+Tag: patch-system-but-direct-changes-in-diff
+Type: warning
+Info: The package uses a patch-system, but the Debian diff.gz contains changes
+ made on files without being separated out in a patch.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-03-03 06:03:37 UTC (rev 1237)
+++ trunk/debian/changelog      2008-03-03 10:48:59 UTC (rev 1238)
@@ -50,6 +50,9 @@
     + [RA] When the menu or desktop file invokes a quoted command via an
       su program, don't try to check whether the command is in the
       package.  Thanks, Paul Wise.  (Closes: #466665)
+  * check/patch-systems:
+    + [HE] Warn if the .diff.gz contains changes while the package uses
+      a patch system. (Closes: #452215)
   * checks/scripts{.desc,}:
     + [FL] Warn if a maintainer script is a valid shell script but
       doesn't seem to have any actual code.  Based on an idea

Modified: trunk/testset/diffs/debian/control
===================================================================
--- trunk/testset/diffs/debian/control  2008-03-03 06:03:37 UTC (rev 1237)
+++ trunk/testset/diffs/debian/control  2008-03-03 10:48:59 UTC (rev 1238)
@@ -2,6 +2,7 @@
 Section: interpreters
 Priority: extra
 Maintainer: Lintian Maintainers <[EMAIL PROTECTED]>
+Build-Depends: dpatch
 Standards-Version: 3.5.9
 
 Package: diffs

Added: trunk/testset/diffs/debian/patches/00list
===================================================================
--- trunk/testset/diffs/debian/patches/00list                           (rev 0)
+++ trunk/testset/diffs/debian/patches/00list   2008-03-03 10:48:59 UTC (rev 
1238)
@@ -0,0 +1,2 @@
+
+

Modified: trunk/testset/tags.diffs
===================================================================
--- trunk/testset/tags.diffs    2008-03-03 06:03:37 UTC (rev 1237)
+++ trunk/testset/tags.diffs    2008-03-03 10:48:59 UTC (rev 1238)
@@ -3,6 +3,7 @@
 E: diffs: missing-dependency-on-libc needed by ./usr/bin/diffs
 E: diffs: no-copyright-file
 E: diffs: unstripped-binary-or-object ./usr/bin/diffs
+I: diffs source: build-depends-without-arch-dep dpatch
 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
@@ -20,6 +21,10 @@
 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: patch-system-but-direct-changes-in-diff .#binary.c.1.34
+W: diffs source: patch-system-but-direct-changes-in-diff .bzr/dummy
+W: diffs source: patch-system-but-direct-changes-in-diff .git/dummy
+W: diffs source: patch-system-but-direct-changes-in-diff binary.c~
 W: diffs: binary-without-manpage usr/bin/diffs
 W: diffs: possible-missing-colon-in-closes Closes #1239124
 W: diffs: possible-missing-colon-in-closes Closes 456712


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to