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

[SCM] Debian package checker branch, master, updated. 2.5.1-69-g9171970



The following commit has been merged in the master branch:
commit 9171970124dc61f4a799a73cf4ed9f5e0994786b
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Jul 11 01:06:06 2011 +0200

    Created and migrated in/to diffstat in Lintian::Collect::Source
    
    With this collection/diffstat no longer unconditionally creates
    the diffstat file in the Lab, since the L::Collect interface
    will fallback to using /dev/null in its absence.

diff --git a/checks/cruft b/checks/cruft
index 556980e..7d26f1f 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -124,7 +124,7 @@ if ($format =~ /^\s*2\.0\s*\z/ or $format =~ /^\s*3\.0\s*\(quilt\)/) {
     my $wanted = sub { check_debfiles($pkg, $info, $droot, \%warned) };
     find($wanted, $droot);
 } elsif (not $info->native) {
-    check_diffstat('diffstat', \%warned);
+    check_diffstat($info->diffstat, \%warned);
 }
 my $wanted = sub { find_cruft($pkg, $info, $info->unpacked, \%warned, $atdinbd, $ltinbd) };
 find($wanted, $info->unpacked);
diff --git a/checks/patch-systems b/checks/patch-systems
index 3f4100f..bda4e3b 100644
--- a/checks/patch-systems
+++ b/checks/patch-systems
@@ -196,7 +196,7 @@ sub run {
 		tag "more-than-one-patch-system";
 	}
 	my @direct;
-	open(STAT, '<', "diffstat") or fail("cannot open diffstat file: $!");
+	open(STAT, '<', $info->diffstat) or fail("cannot open diffstat file: $!");
 	while (<STAT>) {
 		my ($file) = (m,^\s+(.*?)\s+\|,)
 		     or fail("syntax error in diffstat file: $_");
diff --git a/collection/diffstat b/collection/diffstat
index b2121b2..4d6aacc 100755
--- a/collection/diffstat
+++ b/collection/diffstat
@@ -46,11 +46,7 @@ unlink('debian-patch') or fail("cannot unlink debian-patch: $!")
 $ver =~ s/^\d://; #Remove epoch for this
 
 my $diff_file = "${pkg}_${ver}.diff.gz";
-unless (-f $diff_file) {
-# we have to write an empty file so that the checks don't crap out. <sigh>
-  touch_file('diffstat');
-  exit 0;
-}
+exit 0 unless (-f $diff_file);
 
 gunzip_file($diff_file, 'debian-patch');
 
diff --git a/debian/changelog b/debian/changelog
index f02ca17..e0c6c0b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -104,7 +104,11 @@ lintian (2.5.2) UNRELEASED; urgency=low
     + [NT] Symlink checking extended to relative paths as well.
       (Closes: #217023)
 
-  * collections/fields:
+  * collection/diffstat:
+    + [NT] No longer unconditionally creates a diffstat file,
+      since the Lintian::Collect interface will fall back to
+      using /dev/null in its absence.
+  * collection/fields:
     + [NT] Removed creation of cross package symlinks.  They have
       been replaced by the group information that checks are
       passed.
diff --git a/lib/Lintian/Collect/Source.pm b/lib/Lintian/Collect/Source.pm
index 3f11303..407a0b8 100644
--- a/lib/Lintian/Collect/Source.pm
+++ b/lib/Lintian/Collect/Source.pm
@@ -54,6 +54,18 @@ sub changelog {
     return $self->{changelog};
 }
 
+# Returns the path to diffstat result on the diff (if it exists) or an empty file
+# if there is no diff.gz
+#  sub diffstat Needs-Info diffstat
+sub diffstat {
+    my ($self) = @_;
+    return $self->{diffstat} if exists $self->{diffstat};
+    my $dstat = $self->base_dir() . '/diffstat';
+    $dstat = '/dev/null' unless -e $dstat;
+    $self->{diffstat} = $dstat;
+    return $dstat;
+}
+
 # Returns whether the package is a native package.  For everything except
 # format 3.0 (quilt) packages, we base this on whether we have a Debian
 # *.diff.gz file.  3.0 (quilt) packages are always non-native.  Returns true

-- 
Debian package checker


Reply to: