[Reproducible-commits] [strip-nondeterminism] 01/02: Ar files: ignore contents of padding bytes

Andrew Ayer agwa at andrewayer.name
Sat Jan 17 23:35:32 UTC 2015


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 71251cf279b9fb396f58a114a8a7a3f21d0e3de4
Author: Peter De Wachter <pdewacht at gmail.com>
Date:   Sat Jan 17 12:26:52 2015 +0100

    Ar files: ignore contents of padding bytes
    
    The GNU toolchain uses newlines as padding, but the Go toolchain
    writes null bytes. See the endFile function in pack.go:
    http://golang.org/src/cmd/pack/pack.go#L384
---
 lib/File/StripNondeterminism/handlers/ar.pm | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/File/StripNondeterminism/handlers/ar.pm b/lib/File/StripNondeterminism/handlers/ar.pm
index cdbf7c0..c74f45b 100644
--- a/lib/File/StripNondeterminism/handlers/ar.pm
+++ b/lib/File/StripNondeterminism/handlers/ar.pm
@@ -76,14 +76,8 @@ sub normalize {
 		syswrite $fh, sprintf("%-8o", 0644);
 
 		# move to next member
-		seek $fh, $file_header_start + $FILE_HEADER_LENGTH + $file_size, SEEK_SET;
-
-		# if file has an odd length, it is padded with a single \n character
-		if ($file_size % 2 == 1) {
-			$count = read $fh, $buf, 1;
-			die "reading $file failed: $!" if !defined $count;
-			die "Incorrect file padding" if $buf ne "\n";
-		}
+		my $padding = $file_size % 2;
+		seek $fh, $file_header_start + $FILE_HEADER_LENGTH + $file_size + $padding, SEEK_SET;
 
 	}
 

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