[Git][reproducible-builds/strip-nondeterminism][master] 2 commits: Add support for inline archive files for escript (Erlang)
Chris Lamb (@lamby)
gitlab at salsa.debian.org
Mon Sep 8 19:28:10 UTC 2025
Chris Lamb pushed to branch master at Reproducible Builds / strip-nondeterminism
Commits:
90ef48f8 by Matwey Kornilov at 2025-09-08T19:28:06+00:00
Add support for inline archive files for escript (Erlang)
- - - - -
66bd0a63 by Chris Lamb at 2025-09-08T19:28:06+00:00
Merge branch 'escript' into 'master'
Add support for inline archive files for escript (Erlang)
See merge request reproducible-builds/strip-nondeterminism!18
- - - - -
4 changed files:
- lib/File/StripNondeterminism.pm
- lib/File/StripNondeterminism/handlers/pyzip.pm
- + t/fixtures/pyzip/escript.in
- + t/fixtures/pyzip/escript.out
Changes:
=====================================
lib/File/StripNondeterminism.pm
=====================================
@@ -111,7 +111,7 @@ sub get_normalizer_for_file($) {
}
# pyzip - check last due to call to file(1)
- if (_get_file_type($_) =~ m/python3 script executable \((Zip archive|binary data)\)/) {
+ if (_get_file_type($_) =~ m/(python3|escript) script executable \((Zip archive|binary data)\)/) {
my $handler = _handler('pyzip');
return $handler
if File::StripNondeterminism::handlers::pyzip::is_pyzip_file($_);
=====================================
lib/File/StripNondeterminism/handlers/pyzip.pm
=====================================
@@ -55,7 +55,7 @@ sub is_pyzip_file {
return
open($fh, '<', $filename)
- && read($fh, $str, 32)
+ && read($fh, $str, 4096)
&& $str =~ /^#!.*\n\x{50}\x{4b}\x{03}\x{04}/s;
}
@@ -69,7 +69,15 @@ sub normalize {
open my $fh, '<', $filename;
# Save the shebang for later
- my $shebang = <$fh>;
+ my $shebang;
+ while (my $line = <$fh>) {
+ if ($line =~ /^\x{50}\x{4b}\x{03}\x{04}/) {
+ print $stripped $line;
+ last;
+ } else {
+ $shebang .= $line;
+ }
+ }
# Copy through the rest of the file
while (read($fh, $buf, 4096) // die "$filename: read failed: $!") {
=====================================
t/fixtures/pyzip/escript.in
=====================================
Binary files /dev/null and b/t/fixtures/pyzip/escript.in differ
=====================================
t/fixtures/pyzip/escript.out
=====================================
Binary files /dev/null and b/t/fixtures/pyzip/escript.out differ
View it on GitLab: https://salsa.debian.org/reproducible-builds/strip-nondeterminism/-/compare/e27027cc5c2b8366cad56be5c8021df138844be6...66bd0a6397a0e3f42ce89b102e1a458f9422ee93
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/strip-nondeterminism/-/compare/e27027cc5c2b8366cad56be5c8021df138844be6...66bd0a6397a0e3f42ce89b102e1a458f9422ee93
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20250908/51ec2a47/attachment.htm>
More information about the rb-commits
mailing list