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

[SCM] Debian package checker branch, master, updated. 2.2.5-38-gcc59976



The following commit has been merged in the master branch:
commit f8a69b35b2488367ed0c6eb5e52217efd3e24646
Author: Russ Allbery <rra@debian.org>
Date:   Sat Feb 21 14:38:59 2009 -0800

    Support 2.0 and 3.0 (quilt) packages in the cruft check
    
    * checks/cruft:
      + [RA] For Format: 2.0 and Format: 3.0 (quilt) packages, check
        the *.debian.tar.(gz|bz2|lzma) contents instead of expecting
        diffstat output.  (Closes: #515069)

diff --git a/checks/cruft b/checks/cruft
index 0f8ade8..2dcf01c 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -113,13 +113,18 @@ my $atdinbd = $info->relation('build-depends')->implies($AUTOTOOLS);
 # wanted function.  We don't want to make them global because we'll then leak
 # that data across packages in a large Lintian run.
 my %warned;
-check_diffstat("diffstat", \%warned) unless $info->native;
+my $format = $info->field('format');
+if ($format =~ /^\s*2\.0\s*\z/ or $format =~ /^\s*3\.0\s*\(quilt\)/) {
+    my $wanted = sub { check_debfiles($pkg, $info, \%warned) };
+    find($wanted, 'debfiles');
+} elsif (not $info->native) {
+    check_diffstat("diffstat", \%warned);
+}
 my $wanted = sub { find_cruft($pkg, $info, \%warned, $atdinbd) };
 find($wanted, 'unpacked');
 
 # Look for cruft based on file's results
 my $file_info = $info->file_info;
-
 for my $file (keys(%$file_info)) {
     if ($file_info->{$file} =~ m/\bELF\b/) {
 	tag "source-contains-prebuilt-binary", $file;
@@ -191,6 +196,38 @@ sub check_diffstat {
     tag 'empty-debian-diff' unless $saw_file;
 }
 
+# Check the debian directory for problems.  This is used for Format: 2.0 and
+# 3.0 (quilt) packages where there is no Debian diff and hence no diffstat
+# output.  Record any files we warn about in $warned so that we don't warn
+# again when checking the full unpacked source.
+sub check_debfiles {
+    my ($pkg, $info, $warned) = @_;
+    (my $name = $File::Find::name) =~ s,^(\./)?debfiles/,,;
+
+    # Check for unwanted directories and files.  This really duplicates the
+    # find_cruft function and we should find a way to combine them.
+    if (-d) {
+        for my $rule (@directory_checks) {
+            if ($name =~ /$rule->[0]/) {
+                tag "diff-contains-$rule->[1]", "debian/$name";
+                $warned->{"debian/$name"} = 1;
+            }
+        }
+    }
+    -f or return;
+    for my $rule (@file_checks) {
+        if ($name =~ /$rule->[0]/) {
+            tag "diff-contains-$rule->[1]", "debian/$name";
+            $warned->{"debian/$name"} = 1;
+        }
+    }
+
+    # Additional special checks only for the diff, not the full source.
+    if ($name eq 'substvars') {
+        tag 'diff-contains-substvars', "debian/$name";
+    }
+}
+
 # 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.
diff --git a/debian/changelog b/debian/changelog
index b0535c5..586932c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,10 @@ lintian (2.2.6) UNRELEASED; urgency=low
   * checks/control-file:
     + [ADB] Properly exclude packages built from the glibc source package
       from the "hardcoded depends on libc" test.  (Closes: #515831)
+  * checks/cruft:
+    + [RA] For Format: 2.0 and Format: 3.0 (quilt) packages, check
+      the *.debian.tar.(gz|bz2|lzma) contents instead of expecting
+      diffstat output.  (Closes: #515069)
   * checks/deb-format{,.desc}:
     + [RA] Recognize data.tar.lzma binary package components and use a
       different tag than malformed-deb-archive.

-- 
Debian package checker


Reply to: