Skip to content

Commit c55e7ae

Browse files
committed
generate.pl: Don't generate .patch file if empty
Also remove the Dockerfile COPY when no patch is generated.
1 parent 3bb2b37 commit c55e7ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

generate.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,13 @@ sub die_with_sample {
177177
mkdir $dir unless -d $dir;
178178

179179
# Set up the generated DevelPatchPerl.patch
180-
{
180+
if ($patch) {
181181
open my $fh, ">", "$dir/DevelPatchPerl.patch";
182182
print $fh $patch;
183+
$output =~ s!\{\{docker_copy_perl_patch\}\}!COPY *.patch /usr/src/perl/!mg;
184+
}
185+
else {
186+
$output =~ s!\{\{docker_copy_perl_patch\}\}!# No DevelPatchPerl.patch generated!mg;
183187
}
184188

185189
$release->{run_tests} //= "parallel";
@@ -285,7 +289,7 @@ =head1 DESCRIPTION
285289
FROM {{image}}:{{tag}}
286290
LABEL maintainer="Peter Martini <PeterCMartini@GMail.com>, Zak B. Elep <zakame@cpan.org>"
287291
288-
COPY *.patch /usr/src/perl/
292+
{{docker_copy_perl_patch}}
289293
WORKDIR /usr/src/perl
290294
291295
RUN {{docker_slim_run_install}} \

0 commit comments

Comments
 (0)