generate.pl: support perl dists of different compression types
Perl 5.28.0 seems to be distributed only in gzip and xz tarballs now, so adjust accordingly. This now requires a GNU tar with `-a/--auto-compress` option support (tar version >= 1.20) which buildpack-deps Docker image already includes; those wanting to use this script to regenerate, however, should match their tar version as well.
This commit is contained in:
parent
1c201e950e
commit
7720ae37ff
1 changed files with 8 additions and 7 deletions
15
generate.pl
15
generate.pl
|
@ -65,7 +65,8 @@ for my $release (@{$yaml->{releases}}) {
|
||||||
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";
|
$release->{type} ||= 'bz2';
|
||||||
|
my $file = "perl-$release->{version}.tar.$release->{type}";
|
||||||
my $url = "https://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/) {
|
||||||
|
@ -79,7 +80,7 @@ for my $release (@{$yaml->{releases}}) {
|
||||||
qx{rm -fR $dir};
|
qx{rm -fR $dir};
|
||||||
mkdir $dir or die "Couldn't create $dir";
|
mkdir $dir or die "Couldn't create $dir";
|
||||||
qx{
|
qx{
|
||||||
tar -C "downloads" -jxf $dir.tar.bz2 &&\
|
tar -C "downloads" -axf $dir.tar.$release->{type} &&\
|
||||||
cd $dir &&\
|
cd $dir &&\
|
||||||
find . -exec chmod u+w {} + &&\
|
find . -exec chmod u+w {} + &&\
|
||||||
git init &&\
|
git init &&\
|
||||||
|
@ -102,7 +103,7 @@ for my $release (@{$yaml->{releases}}) {
|
||||||
for my $config (keys %builds) {
|
for my $config (keys %builds) {
|
||||||
my $output = $template;
|
my $output = $template;
|
||||||
$output =~ s/\{\{$_\}\}/$release->{$_}/mg
|
$output =~ s/\{\{$_\}\}/$release->{$_}/mg
|
||||||
for (qw(version pause extra_flags sha256 url _tag cpanm_dist_name cpanm_dist_url cpanm_dist_sha256));
|
for (qw(version pause extra_flags sha256 type url _tag cpanm_dist_name cpanm_dist_url cpanm_dist_sha256));
|
||||||
$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",
|
||||||
|
@ -200,10 +201,10 @@ 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 {{url}} -o perl-{{version}}.tar.bz2 \
|
RUN curl -SL {{url}} -o perl-{{version}}.tar.{{type}} \
|
||||||
&& echo '{{sha256}} *perl-{{version}}.tar.bz2' | sha256sum -c - \
|
&& echo '{{sha256}} *perl-{{version}}.tar.{{type}}' | sha256sum -c - \
|
||||||
&& tar --strip-components=1 -xjf perl-{{version}}.tar.bz2 -C /usr/src/perl \
|
&& tar --strip-components=1 -xaf perl-{{version}}.tar.{{type}} -C /usr/src/perl \
|
||||||
&& rm perl-{{version}}.tar.bz2 \
|
&& rm perl-{{version}}.tar.{{type}} \
|
||||||
&& cat *.patch | patch -p1 \
|
&& cat *.patch | patch -p1 \
|
||||||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
|
||||||
&& archBits="$(dpkg-architecture --query DEB_BUILD_ARCH_BITS)" \
|
&& archBits="$(dpkg-architecture --query DEB_BUILD_ARCH_BITS)" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue