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

[lintian] 01/01: Don't emit unnecessary-source-date-epoch-assignment if the package has explicit Build-Depends on dpkg-dev (>= 1.18.8) or debhelper (>= 10.10). (Closes: #892549)



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit 1cc784de0dd4548c1ed79754ef59de4e7219bcd9
Author: Chris Lamb <lamby@debian.org>
Date:   Sat Mar 10 22:21:05 2018 -0800

    Don't emit unnecessary-source-date-epoch-assignment if the package has explicit Build-Depends on dpkg-dev (>= 1.18.8) or debhelper (>= 10.10). (Closes: #892549)
---
 checks/rules.pm                                          |  5 ++++-
 debian/changelog                                         |  5 +++++
 .../debian/debian/control.in                             | 16 ++++++++++++++++
 .../debian/debian/rules                                  |  8 ++++++++
 t/tests/rules-unnecessary-source-date-epoch-unrel/desc   |  5 +++++
 t/tests/rules-unnecessary-source-date-epoch-unrel/tags   |  1 +
 .../debian/debian/compat                                 |  1 +
 .../debian/debian/control.in                             | 16 ++++++++++++++++
 8 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/checks/rules.pm b/checks/rules.pm
index 3638f57..20ae09f 100644
--- a/checks/rules.pm
+++ b/checks/rules.pm
@@ -162,6 +162,7 @@ sub run {
     # other files, since to chase all includes we'd have to have all
     # of its build dependencies installed.
     local $_;
+    my $build_all = $info->relation('build-depends-all');
     my @arch_rules = (qr/^clean$/, qr/^binary-arch$/, qr/^build-arch$/);
     my @indep_rules = (qr/^build$/, qr/^build-indep$/, qr/^binary-indep$/);
     my (@current_targets, %rules_per_target,  %debhelper_group);
@@ -252,7 +253,9 @@ sub run {
             my ($var, $value) = ($1, $2);
             $variables{$var} = $value;
             tag 'unnecessary-source-date-epoch-assignment', "(line $.)"
-              if $var eq 'SOURCE_DATE_EPOCH';
+              if $var eq 'SOURCE_DATE_EPOCH'
+              and not $build_all->implies(
+                'dpkg-dev (>= 1.18.8) | debhelper (>= 10.10)');
         }
 
         # Keep track of whether this portion of debian/rules may be optional
diff --git a/debian/changelog b/debian/changelog
index 94ed690..56894ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,11 @@ lintian (2.5.80) UNRELEASED; urgency=medium
     + [CL] Only check dependency fields in binary packages for
       mail-transport-agent-dependency-does-not-specify-default-mta etc.
       (Closes: #892550)
+  * checks/rules.pm:
+    + [CL] Don't emit unnecessary-source-date-epoch-assignment if the
+      package has explicit Build-Depends on dpkg-dev (>= 1.18.8) or
+      debhelper (>= 10.10).  Thanks to Andreas Metzler for the report.
+      (Closes: #892549)
 
  -- Chris Lamb <lamby@debian.org>  Fri, 09 Mar 2018 22:59:07 -0800
 
diff --git a/t/tests/rules-unnecessary-source-date-epoch-unrel/debian/debian/control.in b/t/tests/rules-unnecessary-source-date-epoch-unrel/debian/debian/control.in
new file mode 100644
index 0000000..895a920
--- /dev/null
+++ b/t/tests/rules-unnecessary-source-date-epoch-unrel/debian/debian/control.in
@@ -0,0 +1,16 @@
+Source: {$source}
+Priority: optional
+Section: python
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}, dpkg-dev (>= 1.18.8), debhelper (>= 10.10)
+Rules-Requires-Root: no
+
+Package: {$source}
+Architecture: all
+Depends: $\{misc:Depends\}
+Description: Test package
+ 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/rules-unnecessary-source-date-epoch-unrel/debian/debian/rules b/t/tests/rules-unnecessary-source-date-epoch-unrel/debian/debian/rules
new file mode 100755
index 0000000..ec2dec6
--- /dev/null
+++ b/t/tests/rules-unnecessary-source-date-epoch-unrel/debian/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog -SDate)" +%s)
+
+export SOURCE_DATE_EPOCH = $(shell date +%s)
+
+%:
+	dh $@
diff --git a/t/tests/rules-unnecessary-source-date-epoch-unrel/desc b/t/tests/rules-unnecessary-source-date-epoch-unrel/desc
new file mode 100644
index 0000000..6ba1545
--- /dev/null
+++ b/t/tests/rules-unnecessary-source-date-epoch-unrel/desc
@@ -0,0 +1,5 @@
+Testname: rules-unnecessary-source-date-epoch-unrel
+Version: 1.0
+Description: Test for unnecessary SOURCE_DATE_EPOCH assignments (false positive)
+Test-Against:
+ unnecessary-source-date-epoch-assignment
diff --git a/t/tests/rules-unnecessary-source-date-epoch-unrel/tags b/t/tests/rules-unnecessary-source-date-epoch-unrel/tags
new file mode 100644
index 0000000..3d133ee
--- /dev/null
+++ b/t/tests/rules-unnecessary-source-date-epoch-unrel/tags
@@ -0,0 +1 @@
+I: rules-unnecessary-source-date-epoch-unrel source: debian-rules-parses-dpkg-parsechangelog (line 3)
diff --git a/t/tests/rules-unnecessary-source-date-epoch/debian/debian/compat b/t/tests/rules-unnecessary-source-date-epoch/debian/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/t/tests/rules-unnecessary-source-date-epoch/debian/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/t/tests/rules-unnecessary-source-date-epoch/debian/debian/control.in b/t/tests/rules-unnecessary-source-date-epoch/debian/debian/control.in
new file mode 100644
index 0000000..bf85e28
--- /dev/null
+++ b/t/tests/rules-unnecessary-source-date-epoch/debian/debian/control.in
@@ -0,0 +1,16 @@
+Source: {$source}
+Priority: optional
+Section: python
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: dpkg-dev (>= 1.18.7), debhelper (>= 10.9)
+Rules-Requires-Root: no
+
+Package: {$source}
+Architecture: all
+Depends: $\{misc:Depends\}
+Description: Test package
+ 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.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: