Source: strip-nondeterminism
Source-Version: 0.042-1
Severity: wishlist
Tags: patch

Hi!

For a while now the libtimedate-perl dependency has bothered me, as
in many cases the same functionality can be implemented with the
Time::Piece core module. Today while checking to do that I noticed
that the code is actually a fallback for an old debhelper. So we can
happily just remove the fallback and the dependency. :)

Attached a patch fixing this.

Thanks,
Guillem
From 0d335422c35dcc9fe198953b1e5aa9bd1377cf86 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Thu, 4 Oct 2018 00:01:17 +0200
Subject: [PATCH] Remove old backwards compatibility debhelper code

The required debhelper version providing the get_source_date_epoch()
function is available since Debian stable (stretch). Let's remove this
code and the unnecessary dependency.

Signed-off-by: Guillem Jover <guil...@debian.org>
---
 bin/dh_strip_nondeterminism | 9 +--------
 debian/control              | 3 +--
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/bin/dh_strip_nondeterminism b/bin/dh_strip_nondeterminism
index ddbb126..bfd3794 100755
--- a/bin/dh_strip_nondeterminism
+++ b/bin/dh_strip_nondeterminism
@@ -11,7 +11,6 @@ use B;
 use File::Find;
 use Debian::Debhelper::Dh_Lib;
 use File::StripNondeterminism;
-use Date::Parse;
 
 =head1 SYNOPSIS
 
@@ -81,13 +80,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	find(\&testfile,$tmp);
 	next unless @nondeterministic_files;
 
-	$File::StripNondeterminism::canonical_time
-	  = eval { get_source_date_epoch() };
-	if (not defined $File::StripNondeterminism::canonical_time) {
-		# Hack for old versions of debhelper
-		isnative($package); # Sets $dh{DATE} as a side-effect
-		$File::StripNondeterminism::canonical_time = str2time($dh{DATE});
-	}
+	$File::StripNondeterminism::canonical_time = get_source_date_epoch();
 
 	verbose_print("Using $File::StripNondeterminism::canonical_time as canonical time");
 
diff --git a/debian/control b/debian/control
index 7d89966..75149f1 100644
--- a/debian/control
+++ b/debian/control
@@ -68,9 +68,8 @@ Description: file non-deterministic information stripper — stand-alone tool
 Package: dh-strip-nondeterminism
 Architecture: all
 Depends:
- debhelper,
+ debhelper (>= 9.20151004),
  libfile-stripnondeterminism-perl (= ${binary:Version}),
- libtimedate-perl,
  ${misc:Depends},
  ${perl:Depends},
 Multi-Arch: foreign
-- 
2.19.0.329.g76f2f5c1e3

Reply via email to