generate.pl: Add patch for Time::Local on perls between 5.26 - 5.30

- https://github.com/Perl/docker-perl/issues/76
- https://github.com/Perl/perl5/issues/17410

For current-supported perls, only 5.28 is affected.
This commit is contained in:
Zak B. Elep 2020-01-21 17:59:22 +08:00
parent b15d6d60e9
commit 70727fb79e

View file

@ -6,6 +6,8 @@ use YAML::XS;
use Devel::PatchPerl;
use LWP::Simple;
use version 0.77;
sub die_with_sample {
die <<EOF;
@ -80,6 +82,9 @@ my $template = do {
<DATA>;
};
# fetch Time-Local test patch for fixing failures upon entering year 2020
my $time_local_patch = get 'https://rt.cpan.org/Public/Ticket/Attachment/1776857/956088/0001-Fix-Time-Local-tests.patch';
my %builds;
# sha256 taken from http://www.cpan.org/authors/id/M/MI/MIYAGAWA/CHECKSUMS
@ -179,6 +184,14 @@ for my $release (@{$config->{releases}}) {
print $fh $patch;
}
# Install additional patch for Time::Local on perls between 5.26 to 5.30
if ( version->parse("v$release->{version}") >= version->parse('v5.26.0')
&& version->parse("v$release->{version}") < version->parse('v5.30.0'))
{
open my $fh, '>', "$dir/Fix-Time-Local-tests.patch";
print $fh $time_local_patch;
}
if (defined $release->{test_parallel} && $release->{test_parallel} eq "no") {
$output =~ s/\{\{test\}\}/make test_harness/;
}