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

Bug#797085: marked as done (lintian: Please detect gzip called without -n option)



Your message dated Thu, 27 Aug 2015 20:57:46 +0200
with message-id <1440701866.1280277.367867521.6A294442@webmail.messagingengine.com>
and subject line Re: Bug#797085: lintian: Please detect gzip called without -n option
has caused the Debian Bug report #797085,
regarding lintian: Please detect gzip called without -n option
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
797085: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=797085
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: lintian
Version: 2.5.36.1
Tags: patch
Severity: wishlist
User: reproducible-builds@lists.alioth.debian.org
Usertags: toolchain
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi,

Patch attached to detect gzip called without the -n option. This
invariably results in an unreproducible build.

Pretty sure there's a negative-lookbehind solution, but it evades me
right a this moment and this is probably more readable anyway.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-
From e7b52b435bca9a4940782a76f3db6d21ac832791 Mon Sep 17 00:00:00 2001
From: Chris Lamb <lamby@debian.org>
Date: Thu, 27 Aug 2015 20:15:33 +0200
Subject: [PATCH] New tag gzip-called-without-no-name-option

---
 checks/rules.desc                         |  6 ++++++
 checks/rules.pm                           |  4 ++++
 t/tests/rules-general/debian/debian/rules | 10 ++++++++++
 t/tests/rules-general/desc                |  3 ++-
 t/tests/rules-general/tags                |  2 ++
 5 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/checks/rules.desc b/checks/rules.desc
index bea0e17..aa63ffa 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -247,3 +247,9 @@ Info: The source package does not have both a build-arch and a build-indep
  .
  Please consider adding both the build-arch and build-indep targets.
 
+Tag: gzip-called-without-no-name-option
+Severity: normal
+Certainty: possible
+Info: The rules files appears to call <tt>gzip</tt> without specifying the
+ <tt>-n</tt> option. This introduces timestamps into the binary package,
+ rendering the package unreproducible.
diff --git a/checks/rules.pm b/checks/rules.pm
index e1fdf73..0e646bf 100644
--- a/checks/rules.pm
+++ b/checks/rules.pm
@@ -219,6 +219,10 @@ sub run {
             tag 'debian-rules-makemaker-prefix-is-deprecated', "line $.";
         }
 
+        if ($line =~ m/\bgzip\b/ && $line !~ m/\s-\w*n\w*\b/) {
+            tag 'gzip-called-without-no-name-option', "line $.";
+        }
+
         # General assignment - save the variable
         if (/^\s*(?:\S+\s+)*?(\S+)\s*([:\?\+])?=\s*(.*+)?$/so) {
             # This is far too simple from a theoretical PoV, but should do
diff --git a/t/tests/rules-general/debian/debian/rules b/t/tests/rules-general/debian/debian/rules
index cddbc03..1c4c31e 100755
--- a/t/tests/rules-general/debian/debian/rules
+++ b/t/tests/rules-general/debian/debian/rules
@@ -9,3 +9,13 @@ clean:
 	dh_clean
 	echo $(DEB_BUILD_OPTS) $(PWD)
 	@echo $(_)
+
+dh_auto_build:
+	# Bad
+	touch filename && gzip filename
+	touch filename && gzip -9 filename
+	
+	# Good
+	gzip -9nmore filename
+	gzip -n9 filename
+	gzip filename -n9
diff --git a/t/tests/rules-general/desc b/t/tests/rules-general/desc
index 1f41c20..417eba5 100644
--- a/t/tests/rules-general/desc
+++ b/t/tests/rules-general/desc
@@ -7,4 +7,5 @@ Test-For:
  debian-rules-should-not-automatically-update-control
  debian-rules-should-not-use-DEB_BUILD_OPTS
  debian-rules-should-not-use-pwd
- debian-rules-should-not-use-underscore-variable
\ No newline at end of file
+ debian-rules-should-not-use-underscore-variable
+ gzip-called-without-no-name-option
diff --git a/t/tests/rules-general/tags b/t/tests/rules-general/tags
index 3e7351b..415e097 100644
--- a/t/tests/rules-general/tags
+++ b/t/tests/rules-general/tags
@@ -3,3 +3,5 @@ E: rules-general source: debian-rules-should-not-automatically-update-control li
 W: rules-general source: debian-rules-should-not-use-DEB_BUILD_OPTS line 10
 W: rules-general source: debian-rules-should-not-use-pwd line 10
 W: rules-general source: debian-rules-should-not-use-underscore-variable line 11
+W: rules-general source: gzip-called-without-no-name-option line 15
+W: rules-general source: gzip-called-without-no-name-option line 16
-- 
2.5.0


--- End Message ---
--- Begin Message ---
Jakub Wilk wrote:
 
> We already have package-contains-timestamped-gzip. Why is another tag 
> needed?

Good grief, of course we do. Closing..


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-

--- End Message ---

Reply to: