[Reproducible-commits] [strip-nondeterminism] 09/10: strip-nondeterminism: add --timestamp option for setting canonical time

Andrew Ayer agwa at andrewayer.name
Sun Nov 16 23:16:06 UTC 2014


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

agwa-guest pushed a commit to branch master
in repository strip-nondeterminism.

commit 8e29141dfedfdad33f4305f69aee5b9673c63f94
Author: Andrew Ayer <agwa at andrewayer.name>
Date:   Sun Nov 16 14:00:21 2014 -0800

    strip-nondeterminism: add --timestamp option for setting canonical time
---
 bin/strip-nondeterminism | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/bin/strip-nondeterminism b/bin/strip-nondeterminism
index e42c22f..0beef90 100755
--- a/bin/strip-nondeterminism
+++ b/bin/strip-nondeterminism
@@ -28,10 +28,10 @@ Getopt::Long::Configure(qw(no_ignore_case permute bundling));
 
 my $cmd = $0;
 $cmd =~ s/.*\///;
-my $usage = "Usage: $cmd [-t|--type FILETYPE] FILENAME\n";
+my $usage = "Usage: $cmd [-t|--type FILETYPE] [-T|--timestamp SECONDS] FILENAME\n";
 
 my @opspec = (
-	'type|t=s', 'help|h', 'version|V',
+	'type|t=s', 'help|h', 'version|V', 'timestamp|T=i'
 );
 my $glop = {};
 GetOptions($glop, @opspec) || die $usage;
@@ -46,6 +46,8 @@ if ($glop->{version}) {
 	exit 0;
 }
 
+$File::StripNondeterminism::canonical_time = $glop->{timestamp};
+
 die $usage if @ARGV == 0;
 
 for my $filename (@ARGV) {
@@ -88,6 +90,11 @@ Use the normalizer for the given file type (ar, gzip, jar, zip).  If this
 option is not specified, the file type is detected automatically based on
 the file name extension.
 
+=item B<-T> I<seconds>, B<--timestamp> I<seconds>
+
+Instead of stripping timestamps from files, set them to the given number
+of seconds since January 1, 1970.
+
 =item B<-h>, B<--help>
 
 Display this help message.

-- 
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