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

[SCM] Debian package checker branch, master, updated. 2.5.3-228-gf8b69bb



The following commit has been merged in the master branch:
commit f8b69bb644185f17e7d66197f3d19fa22c262c78
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Nov 20 11:06:27 2011 +0100

    Check if gzip files were compressed with -n
    
    ... in Multi-Arch: same packages.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/files b/checks/files
index 432599e..2680b99 100644
--- a/checks/files
+++ b/checks/files
@@ -175,6 +175,7 @@ my %linked_against_libvga;
 my $py_support_nver = undef;
 
 my $arch_dep_files = 0;
+my $isma_same = ($info->field ('multi-arch')//'') eq 'same';
 
 # read data from objdump-info file
 foreach my $file (sort keys %{$info->objdump_info}) {
@@ -1057,6 +1058,23 @@ foreach my $file (@{$info->sorted_index}) {
             my $finfo = $info->file_info->{$file} || '';
             if ($finfo !~ m/gzip compressed/) {
                 tag 'gz-file-not-gzip', $file;
+            } elsif ($isma_same) {
+                my $path = $info->unpacked ($file);
+                open my $fd, '<', $path or fail "opening $file: $!";
+                my $buff;
+                # We need to read at least 8 bytes
+                if (sysread($fd, $buff, 1024) >= 8) {
+                    # Extract the flags and the mtime.
+                    #  NN NN  NN NN, NN NN NN NN  - bytes read (in hex, network order)
+                    #  __ __  __ __,    $mtime    - variables
+                    my (undef, $mtime) = unpack ('NN', $buff);
+                    if ($mtime){
+                        tag 'gzip-file-is-not-multi-arch-same-safe', $file;
+                    }
+                } else {
+                    fail "reading $file: $!";
+                }
+                close $fd;
             }
         }
 
diff --git a/checks/files.desc b/checks/files.desc
index e7b282c..92fda72 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -1302,3 +1302,12 @@ Info: This package includes perl modules using obsoleted perl 4-era
  are likely to be removed from the core in perl 5.16. Please either
  remove references to these libraries, or add a dependency on
  <tt>libperl4-corelibs-perl | perl (&lt;&lt; 5.12.3-7)</tt> to this package.
+
+Tag: gzip-file-is-not-multi-arch-same-safe
+Severity: important
+Certainty: certain
+Info: The gzip file contains a timestamp that will differ between
+ architectures.  Multi-Arch: same implies all shared files must be
+ byte-for-byte identical.
+ .
+ This can usually be fixed by passing -n to gzip.
diff --git a/debian/changelog b/debian/changelog
index 6fcaf1e..18dc477 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ lintian (2.5.4) UNRELEASED; urgency=low
   * Summary of tag changes:
     + Added:
       - data.tar.xz-member-without-dpkg-pre-depends
+      - gzip-file-is-not-multi-arch-same-safe
       - init.d-script-does-not-implement-optional-option
       - missing-build-dependency-for-dh-addon
       - package-depends-on-lower-priority-package
@@ -73,6 +74,9 @@ lintian (2.5.4) UNRELEASED; urgency=low
     + [NT] Applied patch from Andrew Starr-Bochicchio to update the
       description of font-in-non-font-package to better reflect current
       font policy.  (Closes: #646838)
+    + [JW,NT] Check that gzip files are compressed with -n in
+      "Multi-Arch: same" packages.  (Closes: #649329)
+      packages.
   * checks/init.d{,.desc}:
     + [NT] Applied patch from Peter Eisentraut to detect init.d scripts
       without support for the optional "status" option.
diff --git a/t/COVERAGE b/t/COVERAGE
index 08cd570..4cbe1ae 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,5 +1,5 @@
-Last generated 2011-11-17
-Coverage: 766/943 (81.23%), w. legacy tests: 875/943 (92.79%)
+Last generated 2011-11-20
+Coverage: 767/944 (81.25%), w. legacy tests: 876/944 (92.80%)
 
 The following tags are not tested by the test suite:
 
diff --git a/t/helpers/bin/create-deb b/t/helpers/bin/create-deb
index 82bbd48..1aec4b7 100755
--- a/t/helpers/bin/create-deb
+++ b/t/helpers/bin/create-deb
@@ -94,7 +94,7 @@ if ($val{'auto-build-data'}) {
     foreach my $file (qw(copyright changelog)) {
         runsystem('install', '-m', '0644', $file,  "root/usr/share/doc/$pkg/$file") if -e $file;
     }
-    runsystem('gzip', '--best', "root/usr/share/doc/$pkg/changelog") if -e './changelog';
+    runsystem('gzip', '-n', '--best', "root/usr/share/doc/$pkg/changelog") if -e './changelog';
     # set root so it works for later :)
     $val{'root'} = 'root/';
 }
diff --git a/t/templates/tests/skel/debian/control.in b/t/tests/files-gzip-ma-same/debian/debian/control.in
similarity index 83%
copy from t/templates/tests/skel/debian/control.in
copy to t/tests/files-gzip-ma-same/debian/debian/control.in
index 96cea01..0926b88 100644
--- a/t/templates/tests/skel/debian/control.in
+++ b/t/tests/files-gzip-ma-same/debian/debian/control.in
@@ -6,10 +6,14 @@ Standards-Version: {$standards_version}
 Build-Depends: debhelper (>= 7.0.50~)
 
 Package: {$srcpkg}
-Architecture: {$architecture}
-Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Architecture: any
+Depends: $\{misc:Depends\}, $\{shlibs:Depends\},
+Multi-Arch: same
 Description: {$description}
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.  It may
  be an empty package.
+
+
+
diff --git a/t/tests/files-gzip-ma-same/debian/debian/rules b/t/tests/files-gzip-ma-same/debian/debian/rules
new file mode 100755
index 0000000..f0500f0
--- /dev/null
+++ b/t/tests/files-gzip-ma-same/debian/debian/rules
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+pkg=files-gzip-ma-same
+
+%:
+	dh $@
+
+override_dh_installchangelogs:
+	dh_installchangelogs
+	[ -f debian/$(pkg)/usr/share/doc/$(pkg)/changelog ] || \
+		gunzip debian/$(pkg)/usr/share/doc/$(pkg)/changelog.gz
+	gzip --best debian/$(pkg)/usr/share/doc/$(pkg)/changelog
diff --git a/t/tests/files-gzip-ma-same/desc b/t/tests/files-gzip-ma-same/desc
new file mode 100644
index 0000000..82ef8b8
--- /dev/null
+++ b/t/tests/files-gzip-ma-same/desc
@@ -0,0 +1,5 @@
+Testname: files-gzip-ma-same
+Sequence: 6000
+Version: 1.0
+Description: Test for issues handling gz in Multi-Arch same pkgs
+Test-for: gzip-file-is-not-multi-arch-same-safe
diff --git a/t/tests/files-gzip-ma-same/tags b/t/tests/files-gzip-ma-same/tags
new file mode 100644
index 0000000..bebe8f8
--- /dev/null
+++ b/t/tests/files-gzip-ma-same/tags
@@ -0,0 +1 @@
+E: files-gzip-ma-same: gzip-file-is-not-multi-arch-same-safe usr/share/doc/files-gzip-ma-same/changelog.gz

-- 
Debian package checker


Reply to: