[Reproducible-commits] [strip-nondeterminism] 01/01: zip: preserve file permissions

Andrew Ayer agwa at andrewayer.name
Mon Sep 21 23:28:11 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 ca32484cf3f6131231a3e48aab53044d637ddc6a
Author: Andrew Ayer <agwa at andrewayer.name>
Date:   Mon Sep 21 15:24:22 2015 -0700

    zip: preserve file permissions
    
    Since Archive::Zip's overwrite() function clobbers them.
    
    Closes: #798384
---
 lib/File/StripNondeterminism/handlers/zip.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/File/StripNondeterminism/handlers/zip.pm b/lib/File/StripNondeterminism/handlers/zip.pm
index e2fe92f..a4ce2e1 100644
--- a/lib/File/StripNondeterminism/handlers/zip.pm
+++ b/lib/File/StripNondeterminism/handlers/zip.pm
@@ -156,7 +156,9 @@ sub normalize {
 		$member->cdExtraField(normalize_extra_fields($member->cdExtraField(), CENTRAL_HEADER));
 		$member->localExtraField(normalize_extra_fields($member->localExtraField(), LOCAL_HEADER));
 	}
+	my $old_perms = (stat($zip_filename))[2] & 07777;
 	$zip->overwrite();
+	chmod($old_perms, $zip_filename);
 	return 1;
 }
 

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