[strip-nondeterminism] 01/02: only call get_normalizer_by_name once

Chris Lamb chris at chris-lamb.co.uk
Sat May 6 09:37:18 UTC 2017


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

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

commit 8571c7b6bdc15d425e040ce9720d4acc199bfac0
Author: Bernhard M. Wiedemann <bwiedemann at suse.de>
Date:   Sat May 6 08:59:18 2017 +0000

    only call get_normalizer_by_name once
    
    because filetype does noch change per filename
---
 bin/strip-nondeterminism | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/bin/strip-nondeterminism b/bin/strip-nondeterminism
index e9dedb6..31b10d4 100755
--- a/bin/strip-nondeterminism
+++ b/bin/strip-nondeterminism
@@ -60,15 +60,16 @@ $File::StripNondeterminism::clamp_time = $clamp_timestamp;
 
 die $usage if @ARGV == 0;
 
+my $normalizer;
+if (defined $filetype) {
+	$normalizer
+	  = File::StripNondeterminism::get_normalizer_by_name($filetype);
+	die "$filetype: Unknown file type\n" unless $normalizer;
+}
 for my $filename (@ARGV) {
 	die "$filename: Does not exist\n" unless -e $filename;
 
-	my $normalizer;
-	if (defined $filetype) {
-		$normalizer
-		  = File::StripNondeterminism::get_normalizer_by_name($filetype);
-		die "$filetype: Unknown file type\n" unless $normalizer;
-	} else {
+	if (!defined $filetype) {
 		$normalizer
 		  = File::StripNondeterminism::get_normalizer_for_file($filename);
 		next unless $normalizer;

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