[Reproducible-commits] [strip-nondeterminism] 01/02: ar handler: preserve execute bit when normalizing permissions
Andrew Ayer
agwa at andrewayer.name
Sun Mar 1 22:54:59 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 20940477f4f1ea511c4db3ec010a5ffe42568e39
Author: Andrew Ayer <agwa at andrewayer.name>
Date: Sun Mar 1 14:51:46 2015 -0800
ar handler: preserve execute bit when normalizing permissions
---
lib/File/StripNondeterminism/handlers/ar.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/File/StripNondeterminism/handlers/ar.pm b/lib/File/StripNondeterminism/handlers/ar.pm
index c74f45b..db64f2b 100644
--- a/lib/File/StripNondeterminism/handlers/ar.pm
+++ b/lib/File/StripNondeterminism/handlers/ar.pm
@@ -63,6 +63,7 @@ sub normalize {
die "Incorrect file magic"
if substr($buf, 58, length($FILE_MAGIC)) ne $FILE_MAGIC;
+ my $file_mode = oct(substr($buf, 40, 8));
my $file_size = substr($buf, 48, 10);
seek $fh, $file_header_start + 16, SEEK_SET;
@@ -73,7 +74,7 @@ sub normalize {
# group
syswrite $fh, sprintf("%-6d", 0);
# file mode
- syswrite $fh, sprintf("%-8o", 0644);
+ syswrite $fh, sprintf("%-8o", ($file_mode & 0100) ? 0755 : 0644);
# move to next member
my $padding = $file_size % 2;
--
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