[Reproducible-commits] [strip-nondeterminism] 03/08: Add framework for "clamping" the timestamp
Andrew Ayer
agwa at andrewayer.name
Fri Jun 10 04:27:28 UTC 2016
This is an automated email from the git hooks/post-receive script.
agwa-guest pushed a commit to branch debian
in repository strip-nondeterminism.
commit 634635b2433a9547ed1fef3dc7d7b45fde4dd612
Author: Andrew Ayer <agwa at andrewayer.name>
Date: Tue Jun 7 22:15:06 2016 -0700
Add framework for "clamping" the timestamp
When clamping is enabled, timestamps are only replaced with the
canonical time if they're later than the canonical time. This way,
only timestamps introduced as part of the build process are replaced.
---
bin/strip-nondeterminism | 6 ++++--
lib/File/StripNondeterminism.pm | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/bin/strip-nondeterminism b/bin/strip-nondeterminism
index 1471313..329b5a0 100755
--- a/bin/strip-nondeterminism
+++ b/bin/strip-nondeterminism
@@ -29,13 +29,14 @@ Getopt::Long::Configure(qw(no_ignore_case permute bundling));
my $cmd = $0;
$cmd =~ s/.*\///;
-my $usage = "Usage: $cmd [-t|--type FILETYPE] [-T|--timestamp SECONDS] FILENAME\n";
+my $usage = "Usage: $cmd [-t|--type FILETYPE] [-T|--timestamp SECONDS] [--clamp-timestamp] FILENAME\n";
-my ($filetype, $timestamp, $want_help, $want_version);
+my ($filetype, $timestamp, $clamp_timestamp, $want_help, $want_version);
my $getopt = Getopt::Long::Parser->new;
$getopt->configure(qw(no_ignore_case permute bundling));
$getopt->getoptions('type|t=s', \$filetype,
'timestamp|T=i', \$timestamp,
+ 'clamp-timestamp!', \$clamp_timestamp,
'help|h', \$want_help,
'version|V', \$want_version) or die $usage;
@@ -53,6 +54,7 @@ $ENV{'TZ'} = 'UTC';
tzset();
$File::StripNondeterminism::canonical_time = $timestamp;
+$File::StripNondeterminism::clamp_time = $clamp_timestamp;
die $usage if @ARGV == 0;
diff --git a/lib/File/StripNondeterminism.pm b/lib/File/StripNondeterminism.pm
index dd24af9..8dc5ac9 100644
--- a/lib/File/StripNondeterminism.pm
+++ b/lib/File/StripNondeterminism.pm
@@ -31,7 +31,7 @@ use File::StripNondeterminism::handlers::png;
use File::StripNondeterminism::handlers::javaproperties;
use File::StripNondeterminism::handlers::zip;
-our($VERSION, $canonical_time);
+our($VERSION, $canonical_time, $clamp_time);
$VERSION = '0.018'; # 0.018
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/strip-nondeterminism.git
More information about the Reproducible-commits
mailing list