Build.pm

filter: Statementstmt 38.3% 79 / 206 Branchbran 6.4% 5 / 78 Conditioncond 10.2% 5 / 49 MC/DCmcdc 0.0% 0 / 27 Subroutinesub 67.7% 21 / 31 Podpod 28.5% 4 / 14 totaltotal 28.1% 114 / 405 CC 62 SCAR 43.2
CC
62
Cov
27%
install
306.0
extract_tarball
56.0
install_from_cpan
56.0
CRAP 75.1
↑ Summary Build/Built.pm »
1 package Perl::Build;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use 5.008001;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 our $VERSION = '1.34';
8  
9 3 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use File::Spec::Functions qw(catfile catdir rel2abs);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use CPAN::Perl::Releases;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use CPAN::Perl::Releases::MetaCPAN;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use File::pushd qw(pushd);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use File::Temp;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 3 ▶use HTTP::Tinyish;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 3 ▶use JSON::PP qw(decode_json);
Subroutine BEGIN: called CC=1 SCAR=0.0
18 3 ▶use Devel::PatchPerl 0.88;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 ▶use Perl::Build::Built;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 3 ▶use Time::Local;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 3 ▶our $CPAN_MIRROR = $ENV{PERL_BUILD_CPAN_MIRROR} || 'https://cpan.metacpan.org';
Condition50%1/2
$ENV{'PERL_BUILD_CPAN_MIRROR'} || 'https://cpan.metacpan.org'
l!l
03
MC/DC0%0/1
$ENV{'PERL_BUILD_CPAN_MIRROR'} || 'https://cpan.metacpan.org'
$ENV{'PERL_BUILD_CPAN_MIRROR'}
Truth table50%1/2
A
A= $ENV{'PERL_BUILD_CPAN_MIRROR'}
Aresult
11
00
23  
24 0 ▶sub available_perls {
Subroutine available_perls: not called CC=4 SCAR=30.0
Pod undocumented
25 0 my $class = shift;
26  
27 0 my $releases = CPAN::Perl::Releases::MetaCPAN->new->get;
28 0 my @available_versions;
29 0 for my $release (@$releases) {
30 0 ▶ if ($release->{name} =~ /^perl-(5.(\d+).(\d+)(-\w+)?)$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($release->{"name"} =~ /^perl-(5.(\d+).(\d+)(-\w+)?)$/) 0 0 0
31 0 my ($version, $major, $minor, $rc) = ($1, $2, $3, $4);
32 0 ▶ my $sort_by = sprintf "%03d%03d%s", $major, $minor, $rc || "ZZZ";
Condition0%0/2
$rc || 'ZZZ'
l!l
00
MC/DC0%0/1
$rc || 'ZZZ'
$rc
Truth table0%0/2
A
A= $rc
Aresult
11
00
33 0 push @available_versions, { version => $version, sort_by => $sort_by };
34 }
35 }
36 0 map { $_->{version} } sort { $b->{sort_by} cmp $a->{sort_by} } @available_versions;
37 }
38  
39 # @return extracted source directory
40 0 ▶sub extract_tarball {
Subroutine extract_tarball: not called CC=7 SCAR=40.3
Pod undocumented
41 0 my ($class, $dist_tarball, $destdir) = @_;
42  
43 # Was broken on Solaris, where GNU tar is probably
44 # installed as 'gtar' - RT #61042
45 0 ▶ my $tar = $^O eq 'solaris' ? 'gtar' : 'tar';
Branch: 1 branch
BranchTrueFalseTotal
$^O eq 'solaris' ? : 0 0 0
46  
47 0 ▶ my $type
Branch: 2 branches
BranchTrueFalseTotal
$dist_tarball =~ /bz2$/ ? : 0 0 0
$dist_tarball =~ /xz$/ ? : 0 0 0
48 = $dist_tarball =~ m/bz2$/ ? 'j'
49 : $dist_tarball =~ m/xz$/ ? 'J'
50 : 'z';
51  
52 0 my $abs_tarball = File::Spec->rel2abs($dist_tarball);
53  
54 0 my @tar_files = `$tar t${type}f "$abs_tarball"`;
55 0 ▶ $? == 0
Branch: 1 branch
BranchTrueFalseTotal
$? == 0 or die "Failed to extract $dist_tarball" 0 0 0
56 or die "Failed to extract $dist_tarball";
57  
58 0 chomp @tar_files;
59 0 my %seen;
60 0 my @prefixes = grep !$seen{$_}++, map m{\A(?:\./)?([^/]+)}, @tar_files;
61  
62 0 ▶ die "$dist_tarball does not contain single directory : @prefixes"
Branch: 1 branch
BranchTrueFalseTotal
if @prefixes != 1 0 0 0
63 if @prefixes != 1;
64  
65 0 ▶ system(qq{cd "$destdir"; $tar x${type}f "$abs_tarball"}) == 0
Branch: 1 branch
BranchTrueFalseTotal
system(qq[cd "$destdir"; $tar x${type}f "$abs_tarball"]) == 0 or die "Failed to extract $dist_tarball" 0 0 0
66 or die "Failed to extract $dist_tarball";
67  
68 0 return catfile($destdir, $prefixes[0]);
69 }
70  
71 5 ▶sub perl_release {
Subroutine perl_release: called CC=7 SCAR=22.6
Pod undocumented
72 5 my ($class, $version) = @_;
73  
74 5 my ($dist_tarball, $dist_tarball_url);
75 5 my @err;
76 5 for my $func (qw/cpan_perl_releases metacpan/) {
77 5 eval {
78 5 ($dist_tarball, $dist_tarball_url) = $class->can("perl_release_by_$func")->($class,$version);
79 };
80 5 ▶ push @err, "[$func] $@" if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 5 5
81 5 ▶ last if $dist_tarball && $dist_tarball_url;
Branch: 1 branch
BranchTrueFalseTotal
if $dist_tarball and $dist_tarball_url 5 0 5
Condition33%1/3
$dist_tarball and $dist_tarball_url
!ll&&!rl&&r
005
MC/DC0%0/2
$dist_tarball and $dist_tarball_url
$dist_tarball $dist_tarball_url
Truth table33%1/3
A and B
A= $dist_tarballB= $dist_tarball_url
ABresult
0X0
100
111
82 }
83 5 ▶ if (!$dist_tarball and !$dist_tarball_url) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($dist_tarball or $dist_tarball_url) 0 5 5
Condition33%1/3
$dist_tarball or $dist_tarball_url
l!l&&r!l&&!r
500
MC/DC0%0/2
$dist_tarball or $dist_tarball_url
$dist_tarball $dist_tarball_url
Truth table33%1/3
A or B
A= $dist_tarballB= $dist_tarball_url
ABresult
1X1
011
000
84 0 push @err, "ERROR: Cannot find the tarball for perl-$version\n";
85 0 die join "", @err;
86 }
87  
88 5 return ($dist_tarball, $dist_tarball_url);
89 }
90  
91 5 ▶sub perl_release_by_cpan_perl_releases {
Subroutine perl_release_by_cpan_perl_releases: called CC=4 SCAR=15.2
Pod undocumented
92 5 my ($class, $version) = @_;
93 5 my $tarballs = CPAN::Perl::Releases::perl_tarballs($version);
94 5 ▶ my $x = $tarballs->{'tar.gz'} || $tarballs->{'tar.bz2'} || $tarballs->{'tar.xz'};
Condition33%2/6
$tarballs->{'tar.gz'} || $tarballs->{'tar.bz2'} || $tarballs->{'tar.xz'}
l!l&&r!l&&!r
500
$tarballs->{"tar.gz"} or $tarballs->{"tar.bz2"}
l!l&&r!l&&!r
500
MC/DC0%0/3
$tarballs->{'tar.gz'} || $tarballs->{'tar.bz2'} || $tarballs->{'tar.xz'}
$tarballs->{"tar.gz"} $tarballs->{"tar.bz2"} $tarballs->{'tar.xz'}
Truth table25%1/4
A or B || C
A= $tarballs->{"tar.gz"}B= $tarballs->{"tar.bz2"}C= $tarballs->{'tar.xz'}
ABCresult
1XX1
01X1
0011
0000
95 5 ▶ die "not found the tarball for perl-$version\n" unless $x;
Branch: 1 branch
BranchTrueFalseTotal
unless $x 0 5 5
96 5 my $dist_tarball = (split("/", $x))[-1];
97 5 my $dist_tarball_url = $CPAN_MIRROR . "/authors/id/$x";
98 5 return ($dist_tarball, $dist_tarball_url);
99 }
100  
101 0 ▶sub perl_release_by_metacpan {
Subroutine perl_release_by_metacpan: not called CC=3 SCAR=24.8
Pod undocumented
102 0 my ($class, $version) = @_;
103 0 my $releases = CPAN::Perl::Releases::MetaCPAN->new->get;
104 0 for my $release (@$releases) {
105 0 ▶ if ($release->{name} eq "perl-$version") {
Branch: 1 branch
BranchTrueFalseTotal
if ($release->{"name"} eq "perl-$version") 0 0 0
106 0 my ($path) = $release->{download_url} =~ m{(/authors/id/.*)};
107 0 my $dist_tarball = (split("/", $path))[-1];
108 0 my $dist_tarball_url = $CPAN_MIRROR . $path;
109 0 return ($dist_tarball, $dist_tarball_url);
110 }
111 }
112 0 die "not found the tarball for perl-$version\n";
113 }
114  
115 0 ▶sub http_get {
Subroutine http_get: not called CC=3 SCAR=24.8
Pod undocumented
116 0 my ($url) = @_;
117  
118 0 my $http = HTTP::Tinyish->new(verify_SSL => 1);
119 0 my $response = $http->get($url);
120 0 ▶ if ($response->{success}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->{'success'}) { } 0 0 0
121 0 return $response->{content};
122 } else {
123 0 ▶ my $msg = $response->{status} == 599 ? ", $response->{content}" : "";
Branch: 1 branch
BranchTrueFalseTotal
$response->{'status'} == 599 ? : 0 0 0
124 0 chomp $msg;
125 0 die "Cannot get content from $url: $response->{status} $response->{reason}$msg\n";
126 }
127 }
128  
129 0 ▶sub http_mirror {
Subroutine http_mirror: not called CC=3 SCAR=24.8
Pod undocumented
130 0 my ($url, $path) = @_;
131  
132 0 my $http = HTTP::Tinyish->new(verify_SSL => 1);
133 0 my $response = $http->mirror($url, $path);
134 0 ▶ if ($response->{success}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->{'success'}) { } 0 0 0
135 0 print "Downloaded $url to $path.\n";
136 } else {
137 0 ▶ my $msg = $response->{status} == 599 ? ", $response->{content}" : "";
Branch: 1 branch
BranchTrueFalseTotal
$response->{'status'} == 599 ? : 0 0 0
138 0 chomp $msg;
139 0 die "Cannot get file from $url: $response->{status} $response->{reason}$msg";
140 }
141 }
142  
143 0 ▶sub install_from_cpan {
Subroutine install_from_cpan: not called CC=7 SCAR=40.3
Pod documented
144 0 my ($class, $version, %args) = @_;
145  
146 0 ▶ $args{patchperl} && Carp::croak "The patchperl argument was deprected.";
Branch: 1 branch
BranchTrueFalseTotal
$args{"patchperl"} and Carp::croak("The patchperl argument was deprected.") 0 0 0
147  
148 my $tarball_dir = $args{tarball_dir}
149 0 ▶ || File::Temp::tempdir( CLEANUP => 1 );
Condition0%0/3
$args{'tarball_dir'} || File::Temp::tempdir('CLEANUP', 1)
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{'tarball_dir'} || File::Temp::tempdir('CLEANUP', 1)
$args{'tarball_dir'} File::Temp::tempdir('CLEANUP', 1)
Truth table0%0/3
A || B
A= $args{'tarball_dir'}B= File::Temp::tempdir('CLEANUP', 1)
ABresult
1X1
011
000
150 my $build_dir = $args{build_dir}
151 0 ▶ || File::Temp::tempdir( CLEANUP => 1 );
Condition0%0/3
$args{'build_dir'} || File::Temp::tempdir('CLEANUP', 1)
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{'build_dir'} || File::Temp::tempdir('CLEANUP', 1)
$args{'build_dir'} File::Temp::tempdir('CLEANUP', 1)
Truth table0%0/3
A || B
A= $args{'build_dir'}B= File::Temp::tempdir('CLEANUP', 1)
ABresult
1X1
011
000
152 my $dst_path = $args{dst_path}
153 0 ▶ or die "Missing mandatory parameter: dst_path";
Branch: 1 branch
BranchTrueFalseTotal
my $dst_path = $args{"dst_path"} or die "Missing mandatory parameter: dst_path" 0 0 0
154 my $configure_options = $args{configure_options}
155 0 ▶ || ['-de'];
Condition0%0/2
$args{'configure_options'} || ['-de']
l!l
00
MC/DC0%0/1
$args{'configure_options'} || ['-de']
$args{'configure_options'}
Truth table0%0/2
A
A= $args{'configure_options'}
Aresult
11
00
156  
157 # download tar ball
158 0 my ($dist_tarball, $dist_tarball_url) = Perl::Build->perl_release($version);
159 0 my $dist_tarball_path = catfile($tarball_dir, $dist_tarball);
160 0 ▶ if (-f $dist_tarball_path) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $dist_tarball_path) { } 0 0 0
161 0 print "Use the previously fetched ${dist_tarball}\n";
162 }
163 else {
164 0 print "Fetching $version as $dist_tarball_path ($dist_tarball_url)\n";
165 0 http_mirror( $dist_tarball_url, $dist_tarball_path );
166 }
167  
168 # and extract tar ball.
169 0 my $dist_extracted_path = Perl::Build->extract_tarball($dist_tarball_path, $build_dir);
170 Perl::Build->install(
171 src_path => $dist_extracted_path,
172 dst_path => $dst_path,
173 configure_options => $configure_options,
174 test => $args{test},
175 jobs => $args{jobs},
176 0 );
177 }
178  
179 0 ▶sub install_from_url {
Subroutine install_from_url: not called CC=7 SCAR=40.3
Pod undocumented
180 0 my ($class, $dist_tarball_url, %args) = @_;
181 0 ▶ $args{patchperl} && Carp::croak "The patchperl argument was deprected.";
Branch: 1 branch
BranchTrueFalseTotal
$args{"patchperl"} and Carp::croak("The patchperl argument was deprected.") 0 0 0
182  
183 my $build_dir = $args{build_dir}
184 0 ▶ || File::Temp::tempdir( CLEANUP => 1 );
Condition0%0/3
$args{'build_dir'} || File::Temp::tempdir('CLEANUP', 1)
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{'build_dir'} || File::Temp::tempdir('CLEANUP', 1)
$args{'build_dir'} File::Temp::tempdir('CLEANUP', 1)
Truth table0%0/3
A || B
A= $args{'build_dir'}B= File::Temp::tempdir('CLEANUP', 1)
ABresult
1X1
011
000
185 my $tarball_dir = $args{tarball_dir}
186 0 ▶ || File::Temp::tempdir( CLEANUP => 1 );
Condition0%0/3
$args{'tarball_dir'} || File::Temp::tempdir('CLEANUP', 1)
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{'tarball_dir'} || File::Temp::tempdir('CLEANUP', 1)
$args{'tarball_dir'} File::Temp::tempdir('CLEANUP', 1)
Truth table0%0/3
A || B
A= $args{'tarball_dir'}B= File::Temp::tempdir('CLEANUP', 1)
ABresult
1X1
011
000
187 my $dst_path = $args{dst_path}
188 0 ▶ or die "Missing mandatory parameter: dst_path";
Branch: 1 branch
BranchTrueFalseTotal
my $dst_path = $args{"dst_path"} or die "Missing mandatory parameter: dst_path" 0 0 0
189 my $configure_options = $args{configure_options}
190 0 ▶ || ['-de'];
Condition0%0/2
$args{'configure_options'} || ['-de']
l!l
00
MC/DC0%0/1
$args{'configure_options'} || ['-de']
$args{'configure_options'}
Truth table0%0/2
A
A= $args{'configure_options'}
Aresult
11
00
191  
192 0 my $dist_tarball = basename($dist_tarball_url);
193 0 my $dist_tarball_path = catfile($tarball_dir, $dist_tarball);
194 0 ▶ if (-f $dist_tarball_path) {
Branch: 1 branch
BranchTrueFalseTotal
if (-f $dist_tarball_path) { } 0 0 0
195 0 print "Use the previously fetched ${dist_tarball}\n";
196 }
197 else {
198 0 print "Fetching $dist_tarball_path ($dist_tarball_url)\n";
199 0 http_mirror( $dist_tarball_url, $dist_tarball_path );
200 }
201  
202 0 my $dist_extracted_path = Perl::Build->extract_tarball($dist_tarball_path, $build_dir);
203 Perl::Build->install(
204 src_path => $dist_extracted_path,
205 dst_path => $dst_path,
206 configure_options => $configure_options,
207 test => $args{test},
208 jobs => $args{jobs},
209 0 );
210 }
211  
212 0 ▶sub install_from_tarball {
Subroutine install_from_tarball: not called CC=5 SCAR=34.0
Pod documented
213 0 my ($class, $dist_tarball_path, %args) = @_;
214 0 ▶ $args{patchperl} && Carp::croak "The patchperl argument was deprected.";
Branch: 1 branch
BranchTrueFalseTotal
$args{"patchperl"} and Carp::croak("The patchperl argument was deprected.") 0 0 0
215  
216 my $build_dir = $args{build_dir}
217 0 ▶ || File::Temp::tempdir( CLEANUP => 1 );
Condition0%0/3
$args{'build_dir'} || File::Temp::tempdir('CLEANUP', 1)
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{'build_dir'} || File::Temp::tempdir('CLEANUP', 1)
$args{'build_dir'} File::Temp::tempdir('CLEANUP', 1)
Truth table0%0/3
A || B
A= $args{'build_dir'}B= File::Temp::tempdir('CLEANUP', 1)
ABresult
1X1
011
000
218 my $dst_path = $args{dst_path}
219 0 ▶ or die "Missing mandatory parameter: dst_path";
Branch: 1 branch
BranchTrueFalseTotal
my $dst_path = $args{"dst_path"} or die "Missing mandatory parameter: dst_path" 0 0 0
220 my $configure_options = $args{configure_options}
221 0 ▶ || ['-de'];
Condition0%0/2
$args{'configure_options'} || ['-de']
l!l
00
MC/DC0%0/1
$args{'configure_options'} || ['-de']
$args{'configure_options'}
Truth table0%0/2
A
A= $args{'configure_options'}
Aresult
11
00
222  
223 0 my $dist_extracted_path = Perl::Build->extract_tarball($dist_tarball_path, $build_dir);
224 Perl::Build->install(
225 src_path => $dist_extracted_path,
226 dst_path => $dst_path,
227 configure_options => $configure_options,
228 test => $args{test},
229 jobs => $args{jobs},
230 0 );
231 }
232  
233 0 ▶sub install {
Subroutine install: not called CC=17 SCAR=57.2
Pod documented
234 0 my ($class, %args) = @_;
235 0 ▶ $args{patchperl} && Carp::croak "The patchperl argument was deprected.";
Branch: 1 branch
BranchTrueFalseTotal
$args{"patchperl"} and Carp::croak("The patchperl argument was deprected.") 0 0 0
236  
237 my $src_path = $args{src_path}
238 0 ▶ or die "Missing mandatory parameter: src_path";
Branch: 1 branch
BranchTrueFalseTotal
my $src_path = $args{"src_path"} or die "Missing mandatory parameter: src_path" 0 0 0
239 my $dst_path = $args{dst_path}
240 0 ▶ or die "Missing mandatory parameter: dst_path";
Branch: 1 branch
BranchTrueFalseTotal
my $dst_path = $args{"dst_path"} or die "Missing mandatory parameter: dst_path" 0 0 0
241 my $configure_options = $args{configure_options}
242 0 ▶ or die "Missing mandatory parameter: configure_options";
Branch: 1 branch
BranchTrueFalseTotal
my $configure_options = $args{"configure_options"} or die "Missing mandatory parameter: configure_options" 0 0 0
243 0 my $jobs = $args{jobs}; # optional
244 0 my $test = $args{test}; # optional
245  
246 0 unshift @$configure_options, qq(-Dprefix=$dst_path);
247  
248 # Perl5 installs public executable scripts(like `prove`) to /usr/local/share/
249 # if it exists.
250 #
251 # This -A'eval:scriptdir=$prefix/bin' option avoid this feature.
252 0 ▶ unless (grep { /eval:scriptdir=/} @$configure_options) {
Branch: 1 branch
BranchTrueFalseTotal
unless (grep {/eval:scriptdir=/;} @$configure_options) 0 0 0
253 0 push @$configure_options, "-A'eval:scriptdir=${dst_path}/bin'";
254 }
255  
256 # clean up environment
257 0 delete $ENV{$_} for qw(PERL5LIB PERL5OPT);
258  
259 {
260 0 my $dir = pushd($src_path);
261  
262 # determine_version is a public API.
263 0 my $dist_version = Devel::PatchPerl->determine_version();
264 0 print "Configuring perl '$dist_version'\n";
265  
266 # clean up
267 0 $class->do_system("rm -f config.sh Policy.sh");
268  
269 # apply patches
270 0 Devel::PatchPerl->patch_source();
271  
272 # configure
273 0 $class->do_system(['sh', 'Configure', @$configure_options]);
274 # patch for older perls
275 # XXX is this needed? patchperl do this?
276 # if (Perl::Build->perl_version_to_integer($dist_version) < Perl::Build->perl_version_to_integer( '5.8.9' )) {
277 # $class->do_system("$^X -i -nle 'print unless /command-line/' makefile x2p/makefile");
278 # }
279  
280 # build
281 0 my @make = qw(make);
282 0 ▶ if ($ENV{PERL_BUILD_COMPILE_OPTIONS}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{"PERL_BUILD_COMPILE_OPTIONS"}) 0 0 0
283 0 push @make, $ENV{PERL_BUILD_COMPILE_OPTIONS};
284 }
285 0 ▶ if ($jobs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($jobs) 0 0 0
286 0 push @make, '-j', $jobs;
287 }
288 0 $class->do_system(\@make);
289 0 ▶ if ($test) {
Branch: 1 branch
BranchTrueFalseTotal
if ($test) 0 0 0
290 0 ▶ local $ENV{TEST_JOBS} = $jobs if $jobs;
Branch: 1 branch
BranchTrueFalseTotal
if $jobs 0 0 0
291 # Test via "make test_harness" if available so we'll get
292 # automatic parallel testing via $HARNESS_OPTIONS. The
293 # "test_harness" target was added in 5.7.3, which was the last
294 # development release before 5.8.0.
295 0 my $test_target = 'test';
296 0 ▶ if ($dist_version && $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/
Branch: 1 branch
BranchTrueFalseTotal
if ($dist_version and $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/ and $1 >= 8 || $1 == 7 && $2 == 3) 0 0 0
Condition0%0/12
$dist_version and $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/ and $1 >= 8 || $1 == 7 && $2 == 3
!ll&&!rl&&r
000
$dist_version and $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/
!ll&&!rl&&r
000
$1 >= 8 or $1 == 7 and $2 == 3
l!l&&r!l&&!r
000
$1 == 7 and $2 == 3
!ll&&!rl&&r
000
MC/DC0%0/5
$dist_version and $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/ and $1 >= 8 || $1 == 7 && $2 == 3
$dist_version $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/ $1 >= 8 $1 == 7 $2 == 3
Truth table0%0/6
A and B and C or D and E
A= $dist_versionB= $dist_version =~ /^5\.([0-9]+)\.([0-9]+)/C= $1 >= 8D= $1 == 7E= $2 == 3
ABCDEresult
0XXXX0
10XXX0
1100X0
110100
111XX1
110111
297 && ($1 >= 8 || $1 == 7 && $2 == 3)) {
298 0 $test_target = "test_harness";
299 }
300 0 $class->do_system([@make, $test_target]);
301 }
302 0 @make = qw(make install);
303 0 ▶ if ($ENV{PERL_BUILD_INSTALL_OPTIONS}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{"PERL_BUILD_INSTALL_OPTIONS"}) 0 0 0
304 0 push @make, $ENV{PERL_BUILD_INSTALL_OPTIONS};
305 }
306 0 $class->do_system(\@make);
307 }
308 0 return Perl::Build::Built->new({
309 installed_path => $dst_path,
310 });
311 }
312  
313 0 ▶sub do_system {
Subroutine do_system: not called CC=4 SCAR=30.0
Pod undocumented
314 0 my ($class, $cmd) = @_;
315  
316 0 ▶ if (ref $cmd eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $cmd eq 'ARRAY') { } 0 0 0
317 0 $class->info(join(' ', @$cmd));
318 0 ▶ system(@$cmd) == 0
Branch: 1 branch
BranchTrueFalseTotal
system(@$cmd) == 0 or die "Installation failure: @$cmd" 0 0 0
319 or die "Installation failure: @$cmd";
320 } else {
321 0 $class->info($cmd);
322 0 ▶ system($cmd) == 0
Branch: 1 branch
BranchTrueFalseTotal
system($cmd) == 0 or die "Installation failure: $cmd" 0 0 0
323 or die "Installation failure: $cmd";
324 }
325 }
326  
327 1 ▶sub symlink_devel_executables {
Subroutine symlink_devel_executables: called CC=3 SCAR=11.0
Pod documented
328 1 my ($class, $bin_dir) = @_;
329  
330 2 ▶ for my $executable (glob("$bin_dir/*")) {
Subroutine BEGIN: called CC=1 SCAR=0.0
331 1 my ($name, $version) = basename( $executable ) =~ m/(.+?)(5\.\d.*)?$/;
332 1 ▶ if ($version) {
Branch: 1 branch
BranchTrueFalseTotal
if ($version) 1 0 1
333 1 my $cmd = "ln -fs $executable $bin_dir/$name";
334 1 $class->info($cmd);
335 1 system($cmd);
336 }
337 }
338 }
339  
340 1 ▶sub info {
Subroutine info: called CC=1 SCAR=0.0
Pod undocumented
341 1 my ($class, @msg) = @_;
342 1 print @msg, "\n";
343 }
344  
345 3 1;
346 __END__
↑ Summary Build/Built.pm »