From 0a6526583afda9ebbde02bbffcc99e92b6b779cc Mon Sep 17 00:00:00 2001 From: "Zak B. Elep" Date: Sun, 13 Aug 2017 00:40:36 +0800 Subject: [PATCH] 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. --- Releases.yaml | 10 ---------- generate.pl | 21 +++++++-------------- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/Releases.yaml b/Releases.yaml index 5e5655d..a715b14 100644 --- a/Releases.yaml +++ b/Releases.yaml @@ -1,58 +1,48 @@ releases: - version: 5.8.9 sha256: 1097fbcd48ceccb2bc735d119c9db399a02a8ab9f7dc53e29e47e6a8d0d72e79 - pause: NWCLARK extra_flags: "-A ccflags=-fwrapv" test_parallel: no buildpack_deps: jessie - version: 5.10.1 sha256: 9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826 - pause: DAPM extra_flags: "-A ccflags=-fwrapv" test_parallel: no buildpack_deps: jessie - version: 5.12.5 sha256: 10749417fd3010aae320a34181ad4cd6a4855c1fc63403b87fa4d630b18e966c - pause: DOM extra_flags: "-A ccflags=-fwrapv" test_parallel: no buildpack_deps: jessie - version: 5.14.4 sha256: eece8c2b0d491bf6f746bd1f4f1bb7ce26f6b98e91c54690c617d7af38964745 - pause: DAPM extra_flags: "-A ccflags=-fwrapv" test_parallel: no buildpack_deps: jessie - version: 5.16.3 sha256: bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8 - pause: RJBS extra_flags: "-A ccflags=-fwrapv" test_parallel: no buildpack_deps: jessie - version: 5.18.4 sha256: 1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5 - pause: RJBS extra_flags: "-A ccflags=-fwrapv" test_parallel: no buildpack_deps: jessie - version: 5.20.3 sha256: 1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b - pause: SHAY - version: 5.22.4 sha256: 8b3122046d1186598082d0e6da53193b045e85e3505e7d37ee0bdd0bdb539b71 - pause: SHAY - version: 5.24.2 sha256: e28c8fa588c4227eb25350036b45d7b1b46d61bb3a2194ee09dc79be6ed0fd0f - pause: SHAY - version: 5.26.0 sha256: f21d66de84982175e95ad15fd8d0e22fed2cc2de7e4394f5d48dbe451be2f6f2 - pause: XSAWYERX diff --git a/generate.pl b/generate.pl index 17639af..c910d73 100755 --- a/generate.pl +++ b/generate.pl @@ -14,10 +14,9 @@ The Releases.yaml file must look roughly like: releases: - version: 5.20.0 sha256: asdasdadas - pause: RJBS -Where version is the version number of Perl, sha256 is the SHA256 of the -tar.bz2 file, and pause is the PAUSE account of the release manager. +Where version is the version number of Perl and sha256 is the SHA256 of +the tar.bz2 file. If needed or desired, extra_flags: can be added, which will be passed verbatim to Configure. @@ -54,13 +53,13 @@ if (! -d "downloads") { } 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/; my $patch; 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" && `sha256sum downloads/$file` =~ /^\Q$release->{sha256}\E\s+\Qdownloads\/$file\E/) { 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; } - $release->{pause} =~ s#(((.).).*)#$3/$2/$1#; + $release->{url} = $url; $release->{extra_flags} = "" unless defined $release->{extra_flags}; $release->{_tag} = $release->{buildpack_deps} || "stretch"; for my $config (keys %builds) { 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; 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. -=item pause - -The PAUSE (CPAN user) account that the release was uploaded to. - -=back - =item OPTIONAL =over 4 @@ -198,7 +191,7 @@ LABEL maintainer="Peter Martini , Zak B. Elep