dist/t9vPd3GCmf/Foo-Bar-0.01/inc/Module/Install/Makefile.pm

filter: Statementstmt 56.7% 109 / 192 Branchbran 26.6% 24 / 90 Conditioncond 28.3% 19 / 67 MC/DCmcdc 2.6% 1 / 38 Subroutinesub 60.8% 14 / 23 Podpod 0.0% 0 / 15 totaltotal 39.2% 167 / 425 CC 78 SCAR 46.6
CC
78
Cov
44%
write
233.0
makemaker_args
116.8
prompt
30.0
CRAP 106.2
« inc/Module/Install/Fetch.pm ↑ Summary inc/Module/Install/Makefile.pm »
1 #line 1
2 #line 1
3 1 ▶package Module::Install::Makefile;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict 'vars';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use ExtUtils::MakeMaker ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 use Module::Install::Base ();
8 1 ▶use Fcntl qw/:flock :seek/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 use vars qw{$VERSION @ISA $ISCORE};
11 1 BEGIN {
12 1 $VERSION = '1.17';
13 @ISA = 'Module::Install::Base';
14 $ISCORE = 1;
15 1 ▶}
Subroutine Makefile: called CC=1 SCAR=0.0
Pod undocumented
16  
17 1 sub Makefile { $_[0] }
18  
19 0 ▶my %seen = ();
Subroutine prompt: not called CC=5 SCAR=34.0
Pod undocumented
20 0  
21 sub prompt {
22 shift;
23 0  
24 0 ▶ # Infinite loop protection
Branch: 1 branch
BranchTrueFalseTotal
if (++$seen{"$c[1]|$c[2]|$_[0]"} > 3) 0 0 0
25 0 my @c = caller();
26 if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
27 die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
28 }
29 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{'AUTOMATED_TESTING'} || -!-t(STDIN) and not $ENV{'PERL_MM_USE_DEFAULT'}) { } 0 0 0
Condition0%0/6
$ENV{"AUTOMATED_TESTING"} || -!-t(STDIN) and not $ENV{"PERL_MM_USE_DEFAULT"}
!ll&&!rl&&r
000
$ENV{"AUTOMATED_TESTING"} or -!-t(STDIN)
l!l&&r!l&&!r
000
MC/DC0%0/3
$ENV{"AUTOMATED_TESTING"} || -!-t(STDIN) and not $ENV{"PERL_MM_USE_DEFAULT"}
$ENV{"AUTOMATED_TESTING"} -!-t(STDIN) not $ENV{"PERL_MM_USE_DEFAULT"}
Truth table0%0/5
A or not(B) and not(C)
A= $ENV{"AUTOMATED_TESTING"}B= -!-t(STDIN)C= not $ENV{"PERL_MM_USE_DEFAULT"}
ABCresult
00X0
1X00
0100
1X11
0111
30 0 # In automated testing or non-interactive session, always use defaults
31 0 if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
32 local $ENV{PERL_MM_USE_DEFAULT} = 1;
33 0 goto &ExtUtils::MakeMaker::prompt;
34 } else {
35 goto &ExtUtils::MakeMaker::prompt;
36 }
37 }
38  
39 # Store a cleaned up version of the MakeMaker version,
40 1 # since we need to behave differently in a variety of
41 # ways based on the MM version.
42 my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
43  
44 5 ▶# If we are passed a param, do a "newer than" comparison.
Subroutine makemaker: called CC=3 SCAR=14.2
Pod undocumented
45 5 ▶# Otherwise, just return the MakeMaker version.
Branch: 1 branch
BranchTrueFalseTotal
@_ < 2 || $makemaker >= eval $_[1] ? : 5 0 5
Condition33%1/3
@_ < 2 or $makemaker >= eval $_[1]
l!l&&r!l&&!r
050
MC/DC0%0/2
@_ < 2 or $makemaker >= eval $_[1]
@_ < 2 $makemaker >= eval $_[1]
Truth table33%1/3
A or B
A= @_ < 2B= $makemaker >= eval $_[1]
ABresult
1X1
011
000
46 sub makemaker {
47 ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
48 }
49  
50 # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified
51 1 # as we only need to know here whether the attribute is an array
52 # or a hash or something else (which may or may not be appendable).
53 my %makemaker_argtype = (
54 C => 'ARRAY',
55 CONFIG => 'ARRAY',
56 # CONFIGURE => 'CODE', # ignore
57 DIR => 'ARRAY',
58 DL_FUNCS => 'HASH',
59 DL_VARS => 'ARRAY',
60 EXCLUDE_EXT => 'ARRAY',
61 EXE_FILES => 'ARRAY',
62 FUNCLIST => 'ARRAY',
63 H => 'ARRAY',
64 IMPORTS => 'HASH',
65 INCLUDE_EXT => 'ARRAY',
66 LIBS => 'ARRAY', # ignore ''
67 MAN1PODS => 'HASH',
68 MAN3PODS => 'HASH',
69 META_ADD => 'HASH',
70 META_MERGE => 'HASH',
71 PL_FILES => 'HASH',
72 PM => 'HASH',
73 PMLIBDIRS => 'ARRAY',
74 PMLIBPARENTDIRS => 'ARRAY',
75 PREREQ_PM => 'HASH',
76 CONFIGURE_REQUIRES => 'HASH',
77 SKIP => 'ARRAY',
78 TYPEMAPS => 'ARRAY',
79 XS => 'HASH',
80 # VERSION => ['version',''], # ignore
81 # _KEEP_AFTER_FLUSH => '',
82  
83 clean => 'HASH',
84 depend => 'HASH',
85 dist => 'HASH',
86 dynamic_lib=> 'HASH',
87 linkext => 'HASH',
88 macro => 'HASH',
89 postamble => 'HASH',
90 realclean => 'HASH',
91 test => 'HASH',
92 tool_autosplit => 'HASH',
93  
94 # special cases where you can use makemaker_append
95 CCFLAGS => 'APPENDABLE',
96 DEFINE => 'APPENDABLE',
97 INC => 'APPENDABLE',
98 LDDLFLAGS => 'APPENDABLE',
99 LDFROM => 'APPENDABLE',
100 3 ▶);
Subroutine makemaker_args: called CC=13 SCAR=47.6
Pod undocumented
101 3  
102 3 ▶sub makemaker_args {
Condition100%2/2
$self->{"makemaker_args"} ||= {}
l!l
21
MC/DC100%1/1
$self->{"makemaker_args"} ||= {}
$self->{"makemaker_args"}
Truth table100%2/2
A
A= $self->{"makemaker_args"}
Aresult
11
00
103 3 my ($self, %new_args) = @_;
104 0 ▶ my $args = ( $self->{makemaker_args} ||= {} );
Branch: 1 branch
BranchTrueFalseTotal
if ($makemaker_argtype{$key}) { } 0 0 0
105 0 ▶ foreach my $key (keys %new_args) {
Branch: 3 branches
BranchTrueFalseTotal
if ($makemaker_argtype{$key} eq 'ARRAY') { } 0 0 0
elsif ($makemaker_argtype{$key} eq 'HASH') { } 0 0 0
elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { } 0 0 0
106 0 ▶ if ($makemaker_argtype{$key}) {
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args->{$key} 0 0 0
107 0 ▶ if ($makemaker_argtype{$key} eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $args->{$key} eq "ARRAY") 0 0 0
108 0 $args->{$key} = [] unless defined $args->{$key};
109 unless (ref $args->{$key} eq 'ARRAY') {
110 0 ▶ $args->{$key} = [$args->{$key}]
Branch: 1 branch
BranchTrueFalseTotal
ref $new_args{$key} eq 'ARRAY' ? : 0 0 0
111 }
112 0 push @{$args->{$key}},
113 0 ref $new_args{$key} eq 'ARRAY'
114 ? @{$new_args{$key}}
115 : $new_args{$key};
116 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args->{$key} 0 0 0
117 0 elsif ($makemaker_argtype{$key} eq 'HASH') {
118 0 $args->{$key} = {} unless defined $args->{$key};
119 foreach my $skey (keys %{ $new_args{$key} }) {
120 $args->{$key}{$skey} = $new_args{$key}{$skey};
121 }
122 0 }
123 elsif ($makemaker_argtype{$key} eq 'APPENDABLE') {
124 $self->makemaker_append($key => $new_args{$key});
125 }
126 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
if (defined $args->{$key}) 0 0 0
127 0 else {
128 if (defined $args->{$key}) {
129 0 warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n};
130 }
131 $args->{$key} = $new_args{$key};
132 3 }
133 }
134 return $args;
135 }
136  
137 0 ▶# For mm args that take multiple space-separated args,
Subroutine makemaker_append: not called CC=2 SCAR=17.9
Pod undocumented
138 0 # append an argument to the current list.
139 0 sub makemaker_append {
140 0 my $self = shift;
141 my $name = shift;
142 0 ▶ my $args = $self->makemaker_args;
Branch: 1 branch
BranchTrueFalseTotal
defined $args->{$name} ? : 0 0 0
143 $args->{$name} = defined $args->{$name}
144 ? join( ' ', $args->{$name}, @_ )
145 : join( ' ', @_ );
146 0 ▶}
Subroutine build_subdirs: not called CC=3 SCAR=24.8
Pod undocumented
147 0  
148 0 ▶sub build_subdirs {
Condition0%0/2
$self->makemaker_args->{"DIR"} ||= []
l!l
00
MC/DC0%0/1
$self->makemaker_args->{"DIR"} ||= []
$self->makemaker_args->{"DIR"}
Truth table0%0/2
A
A= $self->makemaker_args->{"DIR"}
Aresult
11
00
149 0 my $self = shift;
150 0 my $subdirs = $self->makemaker_args->{DIR} ||= [];
151 for my $subdir (@_) {
152 push @$subdirs, $subdir;
153 }
154 0 ▶}
Subroutine clean_files: not called CC=3 SCAR=24.8
Pod undocumented
155 0  
156 0 ▶sub clean_files {
Condition0%0/2
$self->makemaker_args->{"clean"} ||= {}
l!l
00
MC/DC0%0/1
$self->makemaker_args->{"clean"} ||= {}
$self->makemaker_args->{"clean"}
Truth table0%0/2
A
A= $self->makemaker_args->{"clean"}
Aresult
11
00
157 my $self = shift;
158 my $clean = $self->makemaker_args->{clean} ||= {};
159 0 ▶ %$clean = (
Condition0%0/3
$clean->{'FILES'} || ()
l!l&&r!l&&!r
000
MC/DC0%0/2
$clean->{'FILES'} || ()
$clean->{'FILES'} ()
Truth table0%0/3
A || B
A= $clean->{'FILES'}B= ()
ABresult
1X1
011
000
160 %$clean,
161 FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
162 );
163 1 ▶}
Subroutine realclean_files: called CC=3 SCAR=12.0
Pod undocumented
164 1  
165 1 ▶sub realclean_files {
Condition50%1/2
$self->makemaker_args->{"realclean"} ||= {}
l!l
01
MC/DC0%0/1
$self->makemaker_args->{"realclean"} ||= {}
$self->makemaker_args->{"realclean"}
Truth table50%1/2
A
A= $self->makemaker_args->{"realclean"}
Aresult
11
00
166 my $self = shift;
167 my $realclean = $self->makemaker_args->{realclean} ||= {};
168 1 ▶ %$realclean = (
Condition33%1/3
$realclean->{'FILES'} || ()
l!l&&r!l&&!r
010
MC/DC0%0/2
$realclean->{'FILES'} || ()
$realclean->{'FILES'} ()
Truth table33%1/3
A || B
A= $realclean->{'FILES'}B= ()
ABresult
1X1
011
000
169 %$realclean,
170 FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
171 );
172 0 ▶}
Subroutine libs: not called CC=2 SCAR=17.9
Pod undocumented
173 0  
174 0 ▶sub libs {
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
175 0 my $self = shift;
176 my $libs = ref $_[0] ? shift : [ shift ];
177 $self->makemaker_args( LIBS => $libs );
178 0 ▶}
Subroutine inc: not called CC=1 SCAR=6.9
Pod undocumented
179 0  
180 0 sub inc {
181 my $self = shift;
182 $self->makemaker_args( INC => shift );
183 0 ▶}
Subroutine _wanted_t: not called CC=1 SCAR=0.0
184  
185 sub _wanted_t {
186 0 ▶}
Subroutine tests_recursive: not called CC=4 SCAR=30.0
Pod undocumented
187 0  
188 0 ▶sub tests_recursive {
Condition0%0/2
shift() || 't'
l!l
00
MC/DC0%0/1
shift() || 't'
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
189 0 ▶ my $self = shift;
Branch: 1 branch
BranchTrueFalseTotal
unless (-d $dir) 0 0 0
190 0 my $dir = shift || 't';
191 unless ( -d $dir ) {
192 0 ▶ die "tests_recursive dir '$dir' does not exist";
Condition0%0/2
$self->tests || ''
l!l
00
MC/DC0%0/1
$self->tests || ''
$self->tests
Truth table0%0/2
A
A= $self->tests
Aresult
11
00
193 0 }
194 my %tests = map { $_ => 1 } split / /, ($self->tests || '');
195 0 ▶ require File::Find;
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
/\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 0 0 0
Condition0%0/3
/\.t$/ and -f $_
!ll&&!rl&&r
000
MC/DC0%0/2
/\.t$/ and -f $_
/\.t$/ -f $_
Truth table0%0/3
A and B
A= /\.t$/B= -f $_
ABresult
0X0
100
111
196 0 File::Find::find(
197 sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 },
198 0 $dir
199 );
200 $self->tests( join ' ', sort keys %tests );
201 1 ▶}
Subroutine write: called CC=37 SCAR=54.5
Pod undocumented
202 1  
203 1 ▶sub write {
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 1 1
204 my $self = shift;
205 die "&Makefile->write() takes no arguments\n" if @_;
206 1  
207 1 ▶ # Check the current Perl version
Branch: 1 branch
BranchTrueFalseTotal
if ($perl_version) 0 1 1
208 0 ▶ my $perl_version = $self->perl_version;
Branch: 1 branch
BranchTrueFalseTotal
eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version" 0 0 0
209 if ( $perl_version ) {
210 eval "use $perl_version; 1"
211 or die "ERROR: perl: Version $] is installed, "
212 . "but we need version >= $perl_version";
213 }
214 1  
215 # Make sure we have a new enough MakeMaker
216 1 ▶ require ExtUtils::MakeMaker;
Branch: 1 branch
BranchTrueFalseTotal
if ($perl_version and $self->_cmp($perl_version, '5.006') >= 0) { } 0 1 1
Condition33%1/3
$perl_version and $self->_cmp($perl_version, "5.006") >= 0
!ll&&!rl&&r
100
MC/DC0%0/2
$perl_version and $self->_cmp($perl_version, "5.006") >= 0
$perl_version $self->_cmp($perl_version, "5.006") >= 0
Truth table33%1/3
A and B
A= $perl_versionB= $self->_cmp($perl_version, "5.006") >= 0
ABresult
0X0
100
111
217  
218 if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
219 # This previous attempted to inherit the version of
220 # ExtUtils::MakeMaker in use by the module author, but this
221 # was found to be untenable as some authors build releases
222 # using future dev versions of EU:MM that nobody else has.
223 # Instead, #toolchain suggests we use 6.59 which is the most
224 # stable version on CPAN at time of writing and is, to quote
225 # ribasushi, "not terminally fucked, > and tested enough".
226 0 # TODO: We will now need to maintain this over time to push
227 0 # the version up as new versions are released.
228 $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 );
229 $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
230 } else {
231 1 # Allow legacy-compatibility with 5.005 by depending on the
232 1 # most recent EU:MM that supported 5.005.
233 $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 );
234 $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
235 }
236 1  
237 1 # Generate the MakeMaker params
238 1 ▶ my $args = $self->makemaker_args;
Condition33%1/3
$self->module_name || $self->name
l!l&&r!l&&!r
010
MC/DC0%0/2
$self->module_name || $self->name
$self->module_name $self->name
Truth table33%1/3
A || B
A= $self->module_nameB= $self->name
ABresult
1X1
011
000
239 1 $args->{DISTNAME} = $self->name;
240 1 ▶ $args->{NAME} = $self->module_name || $self->name;
Branch: 1 branch
BranchTrueFalseTotal
$args->{"VERSION"} = $self->version or die "ERROR: Can't determine distribution version. Please specify it\nexplicitly via 'version' in Makefile.PL, or set a valid \$VERSION\nin a module, and provide its file path via 'version_from' (or\n'all_from' if you prefer) in Makefile.PL.\n" 1 0 1
241 $args->{NAME} =~ s/-/::/g;
242 $args->{VERSION} = $self->version or die <<'EOT';
243 ERROR: Can't determine distribution version. Please specify it
244 explicitly via 'version' in Makefile.PL, or set a valid $VERSION
245 in a module, and provide its file path via 'version_from' (or
246 'all_from' if you prefer) in Makefile.PL.
247 1 ▶EOT
Branch: 3 branches
BranchTrueFalseTotal
if ($self->tests) { } 0 1 1
elsif ($Module::Install::ExtraTests::use_extratests) { } 0 1 1
elsif (-d 'xt' and $Module::Install::AUTHOR || $ENV{'RELEASE_TESTING'}) { } 0 2 2
248 0  
249 0 if ( $self->tests ) {
250 my @tests = split ' ', $self->tests;
251 0 my %seen;
252 $args->{test} = {
253 TESTS => (join ' ', grep {!$seen{$_}++} @tests),
254 };
255 } elsif ( $Module::Install::ExtraTests::use_extratests ) {
256 ▶ # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness.
Condition16%1/6
-d "xt" and $Module::Install::AUTHOR || $ENV{"RELEASE_TESTING"}
!ll&&!rl&&r
100
$Module::Install::AUTHOR or $ENV{"RELEASE_TESTING"}
l!l&&r!l&&!r
000
MC/DC0%0/3
-d "xt" and $Module::Install::AUTHOR || $ENV{"RELEASE_TESTING"}
-d "xt" $Module::Install::AUTHOR $ENV{"RELEASE_TESTING"}
Truth table25%1/4
A and B or C
A= -d "xt"B= $Module::Install::AUTHORC= $ENV{"RELEASE_TESTING"}
ABCresult
0XX0
1000
11X1
1011
257 # So, just ignore our xt tests here.
258 0 } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
259 $args->{test} = {
260 TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
261 1 ▶ };
Branch: 1 branch
BranchTrueFalseTotal
if ($] >= "5.005") 1 0 1
262 1 }
263 1 ▶ if ( $] >= 5.005 ) {
Condition50%1/2
$self->author || []
l!l
10
MC/DC0%0/1
$self->author || []
$self->author
Truth table50%1/2
A
A= $self->author
Aresult
11
00
264 $args->{ABSTRACT} = $self->abstract;
265 1 ▶ $args->{AUTHOR} = join ', ', @{$self->author || []};
Branch: 1 branch
BranchTrueFalseTotal
if ($self->makemaker("6.1")) 1 0 1
266 1 }
267 if ( $self->makemaker(6.10) ) {
268 $args->{NO_META} = 1;
269 1 ▶ #$args->{NO_MYMETA} = 1;
Branch: 1 branch
BranchTrueFalseTotal
if ($self->makemaker("6.17") and $self->sign) 0 1 1
Condition33%1/3
$self->makemaker("6.17") and $self->sign
!ll&&!rl&&r
010
MC/DC0%0/2
$self->makemaker("6.17") and $self->sign
$self->makemaker("6.17") $self->sign
Truth table33%1/3
A and B
A= $self->makemaker("6.17")B= $self->sign
ABresult
0X0
100
111
270 0 }
271 if ( $self->makemaker(6.17) and $self->sign ) {
272 1 ▶ $args->{SIGN} = 1;
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->is_admin) 1 0 1
273 1 }
274 unless ( $self->is_admin ) {
275 1 ▶ delete $args->{SIGN};
Branch: 1 branch
BranchTrueFalseTotal
if ($self->makemaker("6.31") and $self->license) 1 0 1
Condition33%1/3
$self->makemaker("6.31") and $self->license
!ll&&!rl&&r
001
MC/DC0%0/2
$self->makemaker("6.31") and $self->license
$self->makemaker("6.31") $self->license
Truth table33%1/3
A and B
A= $self->makemaker("6.31")B= $self->license
ABresult
0X0
100
111
276 1 }
277 if ( $self->makemaker(6.31) and $self->license ) {
278 $args->{LICENSE} = $self->license;
279 1 ▶ }
Condition50%1/2
$args->{"PREREQ_PM"} ||= {}
l!l
01
MC/DC0%0/1
$args->{"PREREQ_PM"} ||= {}
$args->{"PREREQ_PM"}
Truth table50%1/2
A
A= $args->{"PREREQ_PM"}
Aresult
11
00
280  
281 0 my $prereq = ($args->{PREREQ_PM} ||= {});
282 0 %$prereq = ( %$prereq,
283 map { @$_ } # flatten [module => version]
284 map { @$_ }
285 grep $_,
286 ($self->requires)
287 );
288 1  
289 # Remove any reference to perl, PREREQ_PM doesn't support it
290 delete $args->{PREREQ_PM}->{perl};
291 1 ▶ 
Condition50%1/2
$args->{"BUILD_REQUIRES"} ||= {}
l!l
01
MC/DC0%0/1
$args->{"BUILD_REQUIRES"} ||= {}
$args->{"BUILD_REQUIRES"}
Truth table50%1/2
A
A= $args->{"BUILD_REQUIRES"}
Aresult
11
00
292 # Merge both kinds of requires into BUILD_REQUIRES
293 2 my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
294 1 %$build_prereq = ( %$build_prereq,
295 map { @$_ } # flatten [module => version]
296 map { @$_ }
297 grep $_,
298 ($self->configure_requires, $self->build_requires)
299 );
300 1  
301 # Remove any reference to perl, BUILD_REQUIRES doesn't support it
302 delete $args->{BUILD_REQUIRES}->{perl};
303 1 ▶ 
Condition50%1/2
$args->{'DIR'} || []
l!l
01
MC/DC0%0/1
$args->{'DIR'} || []
$args->{'DIR'}
Truth table50%1/2
A
A= $args->{'DIR'}
Aresult
11
00
304 1 ▶ # Delete bundled dists from prereq_pm, add it to Makefile DIR
Branch: 1 branch
BranchTrueFalseTotal
if ($self->bundles) 0 1 1
305 0 my $subdirs = ($args->{DIR} || []);
306 0 if ($self->bundles) {
307 0 my %processed;
308 0 foreach my $bundle (@{ $self->bundles }) {
309 0 my ($mod_name, $dist_dir) = @$bundle;
310 0 ▶ delete $prereq->{$mod_name};
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $processed{$dist_dir}) 0 0 0
311 0 ▶ $dist_dir = File::Basename::basename($dist_dir); # dir for building this module
Branch: 1 branch
BranchTrueFalseTotal
if (-d $dist_dir) 0 0 0
312 if (not exists $processed{$dist_dir}) {
313 0 if (-d $dist_dir) {
314 # List as sub-directory to be processed by make
315 push @$subdirs, $dist_dir;
316 0 }
317 # Else do nothing: the module is already present on the system
318 $processed{$dist_dir} = undef;
319 }
320 }
321 1 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->makemaker("6.55_03")) 0 1 1
322 0  
323 0 unless ( $self->makemaker('6.55_03') ) {
324 %$prereq = (%$prereq,%$build_prereq);
325 delete $args->{BUILD_REQUIRES};
326 1 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
if (my $perl_version = $self->perl_version) 0 1 1
327 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version" 0 0 0
328 if ( my $perl_version = $self->perl_version ) {
329 eval "use $perl_version; 1"
330 or die "ERROR: perl: Version $] is installed, "
331 0 ▶ . "but we need version >= $perl_version";
Branch: 1 branch
BranchTrueFalseTotal
if ($self->makemaker("6.48")) 0 0 0
332 0  
333 if ( $self->makemaker(6.48) ) {
334 $args->{MIN_PERL_VERSION} = $perl_version;
335 }
336 1 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
if ($self->installdirs) 0 1 1
337 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
if $args->{"INSTALLDIRS"} 0 0 0
338 0 if ($self->installdirs) {
339 warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS};
340 $args->{INSTALLDIRS} = $self->installdirs;
341 }
342 1  
343 my %args = map {
344 ( $_ => $args->{$_} ) } grep {defined($args->{$_} )
345 1 } keys %$args;
346 1 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
if (my $preop = $self->admin->preop($user_preop)) 0 1 1
347 0 my $user_preop = delete $args{dist}->{PREOP};
348 0 if ( my $preop = $self->admin->preop($user_preop) ) {
349 foreach my $key ( keys %$preop ) {
350 $args{dist}->{$key} = $preop->{$key};
351 }
352 1 }
353 1 ▶ 
Condition50%1/2
$mm->{'FIRST_MAKEFILE'} || 'Makefile'
l!l
10
MC/DC0%0/1
$mm->{'FIRST_MAKEFILE'} || 'Makefile'
$mm->{'FIRST_MAKEFILE'}
Truth table50%1/2
A
A= $mm->{'FIRST_MAKEFILE'}
Aresult
11
00
354 my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
355 $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
356 1 ▶}
Subroutine fix_up_makefile: called CC=8 SCAR=21.2
Pod undocumented
357 1  
358 1 sub fix_up_makefile {
359 1 ▶ my $self = shift;
Condition50%1/2
ref $self->_top || ''
l!l
10
MC/DC0%0/1
ref $self->_top || ''
ref $self->_top
Truth table50%1/2
A
A= ref $self->_top
Aresult
11
00
360 1 ▶ my $makefile_name = shift;
Condition50%1/2
$self->_top->VERSION || ''
l!l
10
MC/DC0%0/1
$self->_top->VERSION || ''
$self->_top->VERSION
Truth table50%1/2
A
A= $self->_top->VERSION
Aresult
11
00
361 my $top_class = ref($self->_top) || '';
362 1 ▶ my $top_version = $self->_top->VERSION || '';
Branch: 1 branch
BranchTrueFalseTotal
$self->preamble ? : 0 1 1
363  
364 my $preamble = $self->preamble
365 ? "# Preamble by $top_class $top_version\n"
366 1 ▶ . $self->preamble
Condition50%1/2
$self->postamble || ''
l!l
01
MC/DC0%0/1
$self->postamble || ''
$self->postamble
Truth table50%1/2
A
A= $self->postamble
Aresult
11
00
367 : '';
368 my $postamble = "# Postamble by $top_class $top_version\n"
369 1 . ($self->postamble || '');
370 1 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open ${makefile_name}: $!" 1 0 1
371 1 local *MAKEFILE;
372 1 open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
373 eval { flock MAKEFILE, LOCK_EX };
374 1 my $makefile = do { local $/; <MAKEFILE> };
375 1  
376 1 $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
377 1 $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
378 1 $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
379 $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
380 $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
381  
382 # Module::Install will never be used to build the Core Perl
383 1 # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
384 # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
385 $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
386 #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
387 1  
388 # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
389 $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g;
390  
391 # XXX - This is currently unused; not sure if it breaks other MM-users
392 1 # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
393 1  
394 1 ▶ seek MAKEFILE, 0, SEEK_SET;
Branch: 1 branch
BranchTrueFalseTotal
print MAKEFILE "$preamble$makefile$postamble" or die $! 1 0 1
395 1 ▶ truncate MAKEFILE, 0;
Branch: 1 branch
BranchTrueFalseTotal
close MAKEFILE or die $! 1 0 1
396 print MAKEFILE "$preamble$makefile$postamble" or die $!;
397 1 close MAKEFILE or die $!;
398  
399 1;
400 1 ▶}
Subroutine preamble: called CC=2 SCAR=7.1
Pod undocumented
401 1  
402 1 ▶sub preamble {
Branch: 1 branch
BranchTrueFalseTotal
if defined $text 0 1 1
403 1 my ($self, $text) = @_;
404 $self->{preamble} = $text . $self->{preamble} if defined $text;
405 $self->{preamble};
406 1 ▶}
Subroutine postamble: called CC=3 SCAR=12.0
Pod undocumented
407 1  
408 1 ▶sub postamble {
Condition33%1/3
$self->{"postamble"} ||= $self->admin->postamble
l!l&&r!l&&!r
001
MC/DC0%0/2
$self->{"postamble"} ||= $self->admin->postamble
$self->{"postamble"} $self->admin->postamble
Truth table33%1/3
A ||= B
A= $self->{"postamble"}B= $self->admin->postamble
ABresult
1X1
011
000
409 1 ▶ my ($self, $text) = @_;
Branch: 1 branch
BranchTrueFalseTotal
if defined $text 0 1 1
410 $self->{postamble} ||= $self->admin->postamble;
411 1 $self->{postamble} .= $text if defined $text;
412 $self->{postamble}
413 1 }
414  
415 1;
416  
417 __END__
« inc/Module/Install/Fetch.pm ↑ Summary inc/Module/Install/Makefile.pm »