Skip to content

Commit cd8c570

Browse files
AnaTofuZzakame
authored andcommitted
variable cpm settings
1 parent f70e8ac commit cd8c570

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

generate.pl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ sub die_with_sample {
9090
sha256 => "3e8c9d9b44a7348f9acc917163dbfc15bd5ea72501492cea3a35b346440ff862",
9191
);
9292

93+
# sha256 checksum is from docker-perl team, cf https://github.com/docker-library/official-images/pull/12612#issuecomment-1158288299
94+
my %cpm = (
95+
url => "https://raw.githubusercontent.com/skaji/cpm/0.997011/cpm",
96+
sha256 => "7dee2176a450a8be3a6b9b91dac603a0c3a7e807042626d3fe6c93d843f75610",
97+
);
98+
9399
die_with_sample unless defined $config->{releases};
94100
die_with_sample unless ref $config->{releases} eq "ARRAY";
95101

@@ -142,6 +148,7 @@ sub die_with_sample {
142148
for my $build (keys %builds) {
143149
$release->{url} = $url;
144150
$release->{"cpanm_dist_$_"} = $cpanm{$_} for keys %cpanm;
151+
$release->{"cpm_dist_$_"} = $cpm{$_} for keys %cpm;
145152

146153
$release->{extra_flags} ||= '';
147154

@@ -151,7 +158,7 @@ sub die_with_sample {
151158

152159
my $output = $template;
153160
$output =~ s/\{\{$_\}\}/$release->{$_}/mg
154-
for (qw(version pause extra_flags sha256 type url image cpanm_dist_name cpanm_dist_url cpanm_dist_sha256));
161+
for (qw(version pause extra_flags sha256 type url image cpanm_dist_name cpanm_dist_url cpanm_dist_sha256 cpm_dist_url cpm_dist_sha256));
155162
$output =~ s/\{\{args\}\}/$builds{$build}/mg;
156163

157164
if ($build =~ /slim/) {
@@ -299,9 +306,9 @@ =head1 DESCRIPTION
299306
&& echo '{{cpanm_dist_sha256}} *{{cpanm_dist_name}}.tar.gz' | sha256sum --strict --check - \
300307
&& tar -xzf {{cpanm_dist_name}}.tar.gz && cd {{cpanm_dist_name}} && perl bin/cpanm . && cd /root \
301308
&& cpanm IO::Socket::SSL \
302-
&& curl -fL https://raw.githubusercontent.com/skaji/cpm/0.997011/cpm -o /usr/local/bin/cpm \
309+
&& curl -fL {{cpm_dist_url}} -o /usr/local/bin/cpm \
303310
# sha256 checksum is from docker-perl team, cf https://github.com/docker-library/official-images/pull/12612#issuecomment-1158288299
304-
&& echo '7dee2176a450a8be3a6b9b91dac603a0c3a7e807042626d3fe6c93d843f75610 */usr/local/bin/cpm' | sha256sum --strict --check - \
311+
&& echo '{{cpm_dist_sha256}} */usr/local/bin/cpm' | sha256sum --strict --check - \
305312
&& chmod +x /usr/local/bin/cpm \
306313
&& {{docker_slim_run_purge}} \
307314
&& rm -fr /root/.cpanm /usr/src/perl /usr/src/{{cpanm_dist_name}}* /tmp/* \

0 commit comments

Comments
 (0)