Commit eee3d8ca authored by Chris Lamb's avatar Chris Lamb 💬

Add a File::StripNondeterminism::init method to avoid tzset DRY violation.

Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent 10814d76
......@@ -11,7 +11,6 @@ use File::Find;
use Debian::Debhelper::Dh_Lib;
use File::StripNondeterminism;
use Date::Parse;
use POSIX qw(tzset);
=head1 SYNOPSIS
......@@ -62,8 +61,7 @@ sub testfile {
}
}
$ENV{'TZ'} = 'UTC';
tzset();
File::StripNondeterminism::init();
foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp=tmpdir($package);
......
......@@ -23,7 +23,6 @@ use strict;
use warnings;
use File::StripNondeterminism;
use POSIX qw(tzset);
use Getopt::Long;
Getopt::Long::Configure(qw(no_ignore_case permute bundling));
......@@ -50,8 +49,7 @@ if ($want_version) {
exit 0;
}
$ENV{'TZ'} = 'UTC';
tzset();
File::StripNondeterminism::init()
$File::StripNondeterminism::canonical_time = $timestamp;
$File::StripNondeterminism::clamp_time = $clamp_timestamp;
......
......@@ -21,6 +21,7 @@ package File::StripNondeterminism;
use strict;
use warnings;
use POSIX qw(tzset);
use File::StripNondeterminism::handlers::ar;
use File::StripNondeterminism::handlers::gettext;
use File::StripNondeterminism::handlers::gzip;
......@@ -35,6 +36,11 @@ our($VERSION, $canonical_time, $clamp_time);
$VERSION = '0.026'; # 0.026
sub init {
$ENV{'TZ'} = 'UTC';
tzset();
}
sub _get_file_type {
my $file=shift;
open (FILE, '-|') # handle all filenames safely
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment