generate.pl: Use single canonical location for getting Perl tarballs

We seem to be using www.cpan.org for getting the Perl tarballs for
patching with Devel::PatchPerl, yet in our generated Dockerfiles we are
using cpan.metacpan.org instead.  Since the former location is listed in
www.perl.org as the canonical Perl source location, let's base from that
as our single source of truth.

This also means we can depend less on finding which PAUSE account has
which Perl release, so let's remove that from the Releases.yaml as well.
This commit is contained in:
Zak B. Elep 2017-08-13 00:40:36 +08:00
parent ccda32e166
commit 0a6526583a
2 changed files with 7 additions and 24 deletions

View file

@ -1,58 +1,48 @@
releases: releases:
- version: 5.8.9 - version: 5.8.9
sha256: 1097fbcd48ceccb2bc735d119c9db399a02a8ab9f7dc53e29e47e6a8d0d72e79 sha256: 1097fbcd48ceccb2bc735d119c9db399a02a8ab9f7dc53e29e47e6a8d0d72e79
pause: NWCLARK
extra_flags: "-A ccflags=-fwrapv" extra_flags: "-A ccflags=-fwrapv"
test_parallel: no test_parallel: no
buildpack_deps: jessie buildpack_deps: jessie
- version: 5.10.1 - version: 5.10.1
sha256: 9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826 sha256: 9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826
pause: DAPM
extra_flags: "-A ccflags=-fwrapv" extra_flags: "-A ccflags=-fwrapv"
test_parallel: no test_parallel: no
buildpack_deps: jessie buildpack_deps: jessie
- version: 5.12.5 - version: 5.12.5
sha256: 10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c sha256: 10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c
pause: DOM
extra_flags: "-A ccflags=-fwrapv" extra_flags: "-A ccflags=-fwrapv"
test_parallel: no test_parallel: no
buildpack_deps: jessie buildpack_deps: jessie
- version: 5.14.4 - version: 5.14.4
sha256: eece8c2b0d491bf6f746bd1f4f1bb7ce26f6b98e91c54690c617d7af38964745 sha256: eece8c2b0d491bf6f746bd1f4f1bb7ce26f6b98e91c54690c617d7af38964745
pause: DAPM
extra_flags: "-A ccflags=-fwrapv" extra_flags: "-A ccflags=-fwrapv"
test_parallel: no test_parallel: no
buildpack_deps: jessie buildpack_deps: jessie
- version: 5.16.3 - version: 5.16.3
sha256: bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8 sha256: bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8
pause: RJBS
extra_flags: "-A ccflags=-fwrapv" extra_flags: "-A ccflags=-fwrapv"
test_parallel: no test_parallel: no
buildpack_deps: jessie buildpack_deps: jessie
- version: 5.18.4 - version: 5.18.4
sha256: 1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5 sha256: 1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5
pause: RJBS
extra_flags: "-A ccflags=-fwrapv" extra_flags: "-A ccflags=-fwrapv"
test_parallel: no test_parallel: no
buildpack_deps: jessie buildpack_deps: jessie
- version: 5.20.3 - version: 5.20.3
sha256: 1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b sha256: 1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b
pause: SHAY
- version: 5.22.4 - version: 5.22.4
sha256: 8b3122046d1186598082d0e6da53193b045e85e3505e7d37ee0bdd0bdb539b71 sha256: 8b3122046d1186598082d0e6da53193b045e85e3505e7d37ee0bdd0bdb539b71
pause: SHAY
- version: 5.24.2 - version: 5.24.2
sha256: e28c8fa588c4227eb25350036b45d7b1b46d61bb3a2194ee09dc79be6ed0fd0f sha256: e28c8fa588c4227eb25350036b45d7b1b46d61bb3a2194ee09dc79be6ed0fd0f
pause: SHAY
- version: 5.26.0 - version: 5.26.0
sha256: f21d66de84982175e95ad15fd8d0e22fed2cc2de7e4394f5d48dbe451be2f6f2 sha256: f21d66de84982175e95ad15fd8d0e22fed2cc2de7e4394f5d48dbe451be2f6f2
pause: XSAWYERX

View file

@ -14,10 +14,9 @@ The Releases.yaml file must look roughly like:
releases: releases:
- version: 5.20.0 - version: 5.20.0
sha256: asdasdadas sha256: asdasdadas
pause: RJBS
Where version is the version number of Perl, sha256 is the SHA256 of the Where version is the version number of Perl and sha256 is the SHA256 of
tar.bz2 file, and pause is the PAUSE account of the release manager. the tar.bz2 file.
If needed or desired, extra_flags: can be added, which will be passed If needed or desired, extra_flags: can be added, which will be passed
verbatim to Configure. verbatim to Configure.
@ -54,13 +53,13 @@ if (! -d "downloads") {
} }
for my $release (@{$yaml->{releases}}) { for my $release (@{$yaml->{releases}}) {
do { die_with_sample unless $release->{$_}} for (qw(version pause sha256)); do { die_with_sample unless $release->{$_}} for (qw(version sha256));
die "Bad version: $release->{version}" unless $release->{version} =~ /\A5\.\d+\.\d+\Z/; die "Bad version: $release->{version}" unless $release->{version} =~ /\A5\.\d+\.\d+\Z/;
my $patch; my $patch;
my $file = "perl-$release->{version}.tar.bz2"; my $file = "perl-$release->{version}.tar.bz2";
my $url = "http://www.cpan.org/src/5.0/$file"; my $url = "https://www.cpan.org/src/5.0/$file";
if (-f "downloads/$file" && if (-f "downloads/$file" &&
`sha256sum downloads/$file` =~ /^\Q$release->{sha256}\E\s+\Qdownloads\/$file\E/) { `sha256sum downloads/$file` =~ /^\Q$release->{sha256}\E\s+\Qdownloads\/$file\E/) {
print "Skipping download of $file, already current\n"; print "Skipping download of $file, already current\n";
@ -88,13 +87,13 @@ for my $release (@{$yaml->{releases}}) {
die "Couldn't create a Devel::PatchPerl patch for $release->{version}" if $? != 0; die "Couldn't create a Devel::PatchPerl patch for $release->{version}" if $? != 0;
} }
$release->{pause} =~ s#(((.).).*)#$3/$2/$1#; $release->{url} = $url;
$release->{extra_flags} = "" unless defined $release->{extra_flags}; $release->{extra_flags} = "" unless defined $release->{extra_flags};
$release->{_tag} = $release->{buildpack_deps} || "stretch"; $release->{_tag} = $release->{buildpack_deps} || "stretch";
for my $config (keys %builds) { for my $config (keys %builds) {
my $output = $template; my $output = $template;
$output =~ s/\{\{$_\}\}/$release->{$_}/mg for (qw(version pause extra_flags sha256 _tag)); $output =~ s/\{\{$_\}\}/$release->{$_}/mg for (qw(version extra_flags sha256 url _tag));
$output =~ s/\{\{args\}\}/$builds{$config}/mg; $output =~ s/\{\{args\}\}/$builds{$config}/mg;
my $dir = sprintf "%i.%03i.%03i-%s", my $dir = sprintf "%i.%03i.%03i-%s",
@ -153,12 +152,6 @@ The actual perl version, such as B<5.20.1>.
The SHA-256 of the C<.tar.bz2> file for that release. The SHA-256 of the C<.tar.bz2> file for that release.
=item pause
The PAUSE (CPAN user) account that the release was uploaded to.
=back
=item OPTIONAL =item OPTIONAL
=over 4 =over 4
@ -198,7 +191,7 @@ LABEL maintainer="Peter Martini <PeterCMartini@GMail.com>, Zak B. Elep <zakame@c
COPY *.patch /usr/src/perl/ COPY *.patch /usr/src/perl/
WORKDIR /usr/src/perl WORKDIR /usr/src/perl
RUN curl -SL https://cpan.metacpan.org/authors/id/{{pause}}/perl-{{version}}.tar.bz2 -o perl-{{version}}.tar.bz2 \ RUN curl -SL {{url}} -o perl-{{version}}.tar.bz2 \
&& echo '{{sha256}} *perl-{{version}}.tar.bz2' | sha256sum -c - \ && echo '{{sha256}} *perl-{{version}}.tar.bz2' | sha256sum -c - \
&& tar --strip-components=1 -xjf perl-{{version}}.tar.bz2 -C /usr/src/perl \ && tar --strip-components=1 -xjf perl-{{version}}.tar.bz2 -C /usr/src/perl \
&& rm perl-{{version}}.tar.bz2 \ && rm perl-{{version}}.tar.bz2 \