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

[lintian] 01/02: t: Be more robust about "now" in files-gzip test



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

nthykier pushed a commit to branch master
in repository lintian.

commit e9e1d940160dd7f841ca478fdc8643805b83c0aa
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Dec 23 20:27:51 2015 +0000

    t: Be more robust about "now" in files-gzip test
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 t/tests/files-gzip/debian/debian/rules | 8 ++++++--
 t/tests/files-gzip/desc                | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/t/tests/files-gzip/debian/debian/rules b/t/tests/files-gzip/debian/debian/rules
index 1d8af89..3c51877 100755
--- a/t/tests/files-gzip/debian/debian/rules
+++ b/t/tests/files-gzip/debian/debian/rules
@@ -7,8 +7,12 @@ override_dh_install:
 	dh_install
 	# we set the mtime to the past
 	touch -m -d "2003-06-21 12:12:12 UTC" debian/$(pkg)/etc/timestamped-past.gz
-	# we set the mtime to right now
-	touch -m debian/$(pkg)/etc/timestamped-now.gz
+	# we set the mtime to "right" now (meaning two hours ahead of
+	# the changelog file).  We use that as "now" to be more robust
+	# about being built in the past/present/future or in weird
+	# time-zones
+	NOW="$$(date -d "$$(dpkg-parsechangelog -SDate)" +%s)" ; \
+	  touch -m -d @"$$((NOW+3600*2))" debian/$(pkg)/etc/timestamped-now.gz
 
 override_dh_installdocs:
 	dh_installdocs
diff --git a/t/tests/files-gzip/desc b/t/tests/files-gzip/desc
index 97ed789..846d419 100644
--- a/t/tests/files-gzip/desc
+++ b/t/tests/files-gzip/desc
@@ -3,6 +3,7 @@ Sequence: 6000
 Version: 1.0-1
 Type: non-native
 Description: Test for issues handling gz but not gzip files
+Test-Depends: dpkg (>= 1.17)
 Test-for:
  gz-file-not-gzip
  package-contains-timestamped-gzip

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


Reply to: