Skip to content

Commit 0a65265

Browse files
committed
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.
1 parent ccda32e commit 0a65265

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

Releases.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,48 @@
11
releases:
22
- version: 5.8.9
33
sha256: 1097fbcd48ceccb2bc735d119c9db399a02a8ab9f7dc53e29e47e6a8d0d72e79
4-
pause: NWCLARK
54
extra_flags: "-A ccflags=-fwrapv"
65
test_parallel: no
76
buildpack_deps: jessie
87

98
- version: 5.10.1
109
sha256: 9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826
11-
pause: DAPM
1210
extra_flags: "-A ccflags=-fwrapv"
1311
test_parallel: no
1412
buildpack_deps: jessie
1513

1614
- version: 5.12.5
1715
sha256: 10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c
18-
pause: DOM
1916
extra_flags: "-A ccflags=-fwrapv"
2017
test_parallel: no
2118
buildpack_deps: jessie
2219

2320
- version: 5.14.4
2421
sha256: eece8c2b0d491bf6f746bd1f4f1bb7ce26f6b98e91c54690c617d7af38964745
25-
pause: DAPM
2622
extra_flags: "-A ccflags=-fwrapv"
2723
test_parallel: no
2824
buildpack_deps: jessie
2925

3026
- version: 5.16.3
3127
sha256: bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8
32-
pause: RJBS
3328
extra_flags: "-A ccflags=-fwrapv"
3429
test_parallel: no
3530
buildpack_deps: jessie
3631

3732
- version: 5.18.4
3833
sha256: 1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5
39-
pause: RJBS
4034
extra_flags: "-A ccflags=-fwrapv"
4135
test_parallel: no
4236
buildpack_deps: jessie
4337

4438
- version: 5.20.3
4539
sha256: 1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b
46-
pause: SHAY
4740

4841
- version: 5.22.4
4942
sha256: 8b3122046d1186598082d0e6da53193b045e85e3505e7d37ee0bdd0bdb539b71
50-
pause: SHAY
5143

5244
- version: 5.24.2
5345
sha256: e28c8fa588c4227eb25350036b45d7b1b46d61bb3a2194ee09dc79be6ed0fd0f
54-
pause: SHAY
5546

5647
- version: 5.26.0
5748
sha256: f21d66de84982175e95ad15fd8d0e22fed2cc2de7e4394f5d48dbe451be2f6f2
58-
pause: XSAWYERX

generate.pl

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ sub die_with_sample {
1414
releases:
1515
- version: 5.20.0
1616
sha256: asdasdadas
17-
pause: RJBS
1817
19-
Where version is the version number of Perl, sha256 is the SHA256 of the
20-
tar.bz2 file, and pause is the PAUSE account of the release manager.
18+
Where version is the version number of Perl and sha256 is the SHA256 of
19+
the tar.bz2 file.
2120
2221
If needed or desired, extra_flags: can be added, which will be passed
2322
verbatim to Configure.
@@ -54,13 +53,13 @@ sub die_with_sample {
5453
}
5554

5655
for my $release (@{$yaml->{releases}}) {
57-
do { die_with_sample unless $release->{$_}} for (qw(version pause sha256));
56+
do { die_with_sample unless $release->{$_}} for (qw(version sha256));
5857

5958
die "Bad version: $release->{version}" unless $release->{version} =~ /\A5\.\d+\.\d+\Z/;
6059

6160
my $patch;
6261
my $file = "perl-$release->{version}.tar.bz2";
63-
my $url = "http://www.cpan.org/src/5.0/$file";
62+
my $url = "https://www.cpan.org/src/5.0/$file";
6463
if (-f "downloads/$file" &&
6564
`sha256sum downloads/$file` =~ /^\Q$release->{sha256}\E\s+\Qdownloads\/$file\E/) {
6665
print "Skipping download of $file, already current\n";
@@ -88,13 +87,13 @@ sub die_with_sample {
8887
die "Couldn't create a Devel::PatchPerl patch for $release->{version}" if $? != 0;
8988
}
9089

91-
$release->{pause} =~ s#(((.).).*)#$3/$2/$1#;
90+
$release->{url} = $url;
9291
$release->{extra_flags} = "" unless defined $release->{extra_flags};
9392
$release->{_tag} = $release->{buildpack_deps} || "stretch";
9493

9594
for my $config (keys %builds) {
9695
my $output = $template;
97-
$output =~ s/\{\{$_\}\}/$release->{$_}/mg for (qw(version pause extra_flags sha256 _tag));
96+
$output =~ s/\{\{$_\}\}/$release->{$_}/mg for (qw(version extra_flags sha256 url _tag));
9897
$output =~ s/\{\{args\}\}/$builds{$config}/mg;
9998

10099
my $dir = sprintf "%i.%03i.%03i-%s",
@@ -153,12 +152,6 @@ =head1 DESCRIPTION
153152
154153
The SHA-256 of the C<.tar.bz2> file for that release.
155154
156-
=item pause
157-
158-
The PAUSE (CPAN user) account that the release was uploaded to.
159-
160-
=back
161-
162155
=item OPTIONAL
163156
164157
=over 4
@@ -198,7 +191,7 @@ =head1 DESCRIPTION
198191
COPY *.patch /usr/src/perl/
199192
WORKDIR /usr/src/perl
200193
201-
RUN curl -SL https://cpan.metacpan.org/authors/id/{{pause}}/perl-{{version}}.tar.bz2 -o perl-{{version}}.tar.bz2 \
194+
RUN curl -SL {{url}} -o perl-{{version}}.tar.bz2 \
202195
&& echo '{{sha256}} *perl-{{version}}.tar.bz2' | sha256sum -c - \
203196
&& tar --strip-components=1 -xjf perl-{{version}}.tar.bz2 -C /usr/src/perl \
204197
&& rm perl-{{version}}.tar.bz2 \

0 commit comments

Comments
 (0)