Commit 3f47b749 authored by Andrew Ayer's avatar Andrew Ayer

gzip: don't set a canonical timestamp if file didn't already have a timestamp

Closes: #785742
parent fcc9a600
......@@ -54,8 +54,10 @@ sub normalize {
my $new_flg = $flg;
$new_flg &= ~FNAME; # Don't include filename
$new_flg &= ~FHCRC; # Don't include header CRC (not all implementations support it)
# If there's no canonical time set, zero out the mtime (this is what `gzip -n` does):
$mtime = $File::StripNondeterminism::canonical_time // 0;
unless ($mtime == 0) { # Don't set a deterministic timestamp if there wasn't already a timestamp
# If there's no canonical time set, zero out the mtime (this is what `gzip -n` does):
$mtime = $File::StripNondeterminism::canonical_time // 0;
}
# TODO: question: normalize some of the other fields, such as OS?
my $tempfile = File::Temp->new(DIR => dirname($filename));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment