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

[SCM] Debian package checker branch, master, updated. 2.5.2-94-gfe0699f



The following commit has been merged in the master branch:
commit fe0699faa23a9f60a1b62d0014028ddfeac1036d
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Sep 4 07:45:57 2011 +0200

    Use lsdiff instead of diffstat in checks/patch-systems
    
    lsdiff is slightly more reliable than diffstat for checking if a
    patch modifies a given file.

diff --git a/checks/patch-systems b/checks/patch-systems
index bda4e3b..34f0dc9 100644
--- a/checks/patch-systems
+++ b/checks/patch-systems
@@ -217,21 +217,21 @@ sub run {
 sub check_patch {
 	my ($dpdir, $patch_file) = @_;
 
-	# Use -p1 to strip off the first layer of directory in case the parent
+	# Use --strip=1 to strip off the first layer of directory in case the parent
 	# directory in which the patches were generated was named "debian".
-	# This will produce false negatives for -p0 patches that modify files
+	# This will produce false negatives for --strip=0 patches that modify files
 	# in the debian/* directory, but as of 2010-01-01, all cases where the
 	# first level of the patch path is "debian/" in the archive are false
 	# positives.
-	open(DIFFSTAT, "-|", 'diffstat', '-p1', '-l', "$dpdir/$patch_file")
-	  or fail("can't fork diffstat");
-	while (<DIFFSTAT>) {
+	open(my $fd, '-|', 'lsdiff', '--strip=1', "$dpdir/$patch_file")
+	  or fail('cannot fork lsdiff');
+	while (<$fd>) {
 		chomp;
-		if (m|^(\./)?debian/|) {
-			tag "patch-modifying-debian-files", $patch_file, $_;
+		if (m|^(?:\./)?debian/|o) {
+			tag 'patch-modifying-debian-files', $patch_file, $_;
 		}
 	}
-	close(DIFFSTAT) or fail("cannot close pipe to diffstat on $patch_file: $!");
+	close($fd) or fail("cannot close pipe to lsdiff on $patch_file: $!");
 }
 
 1;
diff --git a/debian/changelog b/debian/changelog
index 27ec941..357a3a0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -90,6 +90,9 @@ lintian (2.5.3) UNRELEASED; urgency=low
   * checks/menus.desc:
     + [NT] Added reference to the doc-base manual to help people
       find the list of valid doc-base sections.  (Closes: #584280)
+  * checks/patch-systems:
+    + [NT] Use lsdiff to determine if a patch modifies the debian dir as
+      it is more accurate than diffstat for this.  (Closes: #640131)
   * checks/shared-libs{,.desc}:
     + [JW] Fixed a typo in a tag description.  (Closes: #639177)
     + [NT] Do not emit shlib-calls-exit for libraries that have an
@@ -121,6 +124,8 @@ lintian (2.5.3) UNRELEASED; urgency=low
       Jakub Wilk for spotting those.
     + [JW] Added more corrections.  (Closes: #639367, #640149)
 
+  * debian/control:
+    + [NT] (Build-)Depends on patchutils for lsdiff.
   * debian/copyright:
     + [NT] Added Jakub Wilk to maintainers.
   * debian/rules:
diff --git a/debian/control b/debian/control
index 651c575..ec4af83 100644
--- a/debian/control
+++ b/debian/control
@@ -40,6 +40,7 @@ Build-Depends: binutils,
                locales,
                xz-lzma | lzma,
                man-db,
+               patchutils,
                perl,
                perl (>= 5.12) | libtest-simple-perl (>= 0.93),
                python,
@@ -70,6 +71,7 @@ Depends: binutils,
          liburi-perl,
          locales,
          man-db,
+         patchutils,
          perl,
          unzip,
          ${misc:Depends}

-- 
Debian package checker


Reply to: