| 1 | #line 1 | ||||||||||||||||||||||||||||
| 2 | package Module::Install::Makefile; | ||||||||||||||||||||||||||||
| 3 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict 'vars'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use ExtUtils::MakeMaker (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | use Module::Install::Base (); | ||||||||||||||||||||||||||||
| 7 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use vars qw{$VERSION @ISA $ISCORE}; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | BEGIN { | |||||||||||||||||||||||||||
| 10 | 1 | $VERSION = '0.91'; | |||||||||||||||||||||||||||
| 11 | 1 | @ISA = 'Module::Install::Base'; | |||||||||||||||||||||||||||
| 12 | $ISCORE = 1; | ||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||
| 14 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
Makefile: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 15 | sub Makefile { $_[0] } | ||||||||||||||||||||||||||||
| 16 | 1 | ||||||||||||||||||||||||||||
| 17 | my %seen = (); | ||||||||||||||||||||||||||||
| 18 | 0 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
prompt: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | 0 | sub prompt { | |||||||||||||||||||||||||||
| 20 | shift; | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | # Infinite loop protection | |||||||||||||||||||||||||||
| 23 | 0 | ▶ | my @c = caller(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 0 | if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { | |||||||||||||||||||||||||||
| 25 | die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | # In automated testing, always use defaults | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ENV{"AUTOMATED_TESTING"} and not $ENV{"PERL_MM_USE_DEFAULT"}
MC/DC0%0/2
$ENV{"AUTOMATED_TESTING"} and not $ENV{"PERL_MM_USE_DEFAULT"}
$ENV{"AUTOMATED_TESTING"}
not $ENV{"PERL_MM_USE_DEFAULT"}
Truth table0%0/3
A and not(B)
A= $ENV{"AUTOMATED_TESTING"}B= not $ENV{"PERL_MM_USE_DEFAULT"}
| |||||||||||||||||||||||||||||
| 29 | 0 | if ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL_MM_USE_DEFAULT} ) { | |||||||||||||||||||||||||||
| 30 | 0 | local $ENV{PERL_MM_USE_DEFAULT} = 1; | |||||||||||||||||||||||||||
| 31 | goto &ExtUtils::MakeMaker::prompt; | ||||||||||||||||||||||||||||
| 32 | 0 | } else { | |||||||||||||||||||||||||||
| 33 | goto &ExtUtils::MakeMaker::prompt; | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | 12 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
makemaker_args: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | 12 | sub makemaker_args { | |||||||||||||||||||||||||||
| 38 | 12 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"makemaker_args"} ||= {}
MC/DC100%1/1
$self->{"makemaker_args"} ||= {}
$self->{"makemaker_args"}
Truth table100%2/2
A
A= $self->{"makemaker_args"}
| |||||||||||||||||||||||||||||
| 39 | 12 | my $args = ( $self->{makemaker_args} ||= {} ); | |||||||||||||||||||||||||||
| 40 | 12 | %$args = ( %$args, @_ ); | |||||||||||||||||||||||||||
| 41 | return $args; | ||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | # For mm args that take multiple space-seperated args, | ||||||||||||||||||||||||||||
| 45 | 0 | ▶ | # append an argument to the current list. | ||||||||||||||||||||||||||
|
Subroutine
makemaker_append: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 46 | 0 | sub makemaker_append { | |||||||||||||||||||||||||||
| 47 | 0 | my $self = sShift; | |||||||||||||||||||||||||||
| 48 | 0 | my $name = shift; | |||||||||||||||||||||||||||
| 49 | my $args = $self->makemaker_args; | ||||||||||||||||||||||||||||
| 50 | 0 | ▶ | $args->{name} = defined $args->{$name} | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | ? join( ' ', $args->{name}, @_ ) | ||||||||||||||||||||||||||||
| 52 | : join( ' ', @_ ); | ||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | 0 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
build_subdirs: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 55 | 0 | sub build_subdirs { | |||||||||||||||||||||||||||
| 56 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->makemaker_args->{"DIR"} ||= []
MC/DC0%0/1
$self->makemaker_args->{"DIR"} ||= []
$self->makemaker_args->{"DIR"}
Truth table0%0/2
A
A= $self->makemaker_args->{"DIR"}
| |||||||||||||||||||||||||||||
| 57 | 0 | my $subdirs = $self->makemaker_args->{DIR} ||= []; | |||||||||||||||||||||||||||
| 58 | 0 | for my $subdir (@_) { | |||||||||||||||||||||||||||
| 59 | push @$subdirs, $subdir; | ||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | 2 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
clean_files: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 63 | 2 | sub clean_files { | |||||||||||||||||||||||||||
| 64 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Condition100%2/2
$self->makemaker_args->{"clean"} ||= {}
MC/DC100%1/1
$self->makemaker_args->{"clean"} ||= {}
$self->makemaker_args->{"clean"}
Truth table100%2/2
A
A= $self->makemaker_args->{"clean"}
| |||||||||||||||||||||||||||||
| 65 | my $clean = $self->makemaker_args->{clean} ||= {}; | ||||||||||||||||||||||||||||
| 66 | %$clean = ( | ||||||||||||||||||||||||||||
| 67 | 2 | ▶ | %$clean, | ||||||||||||||||||||||||||
|
Condition66%2/3
$clean->{'FILES'} || ()
MC/DC0%0/2
$clean->{'FILES'} || ()
$clean->{'FILES'}
()
Truth table66%2/3
A || B
A= $clean->{'FILES'}B= ()
| |||||||||||||||||||||||||||||
| 68 | FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), | ||||||||||||||||||||||||||||
| 69 | ); | ||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
realclean_files: called CC=3 SCAR=12.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 72 | 1 | sub realclean_files { | |||||||||||||||||||||||||||
| 73 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Condition50%1/2
$self->makemaker_args->{"realclean"} ||= {}
MC/DC0%0/1
$self->makemaker_args->{"realclean"} ||= {}
$self->makemaker_args->{"realclean"}
Truth table50%1/2
A
A= $self->makemaker_args->{"realclean"}
| |||||||||||||||||||||||||||||
| 74 | my $realclean = $self->makemaker_args->{realclean} ||= {}; | ||||||||||||||||||||||||||||
| 75 | %$realclean = ( | ||||||||||||||||||||||||||||
| 76 | 1 | ▶ | %$realclean, | ||||||||||||||||||||||||||
|
Condition33%1/3
$realclean->{'FILES'} || ()
MC/DC0%0/2
$realclean->{'FILES'} || ()
$realclean->{'FILES'}
()
Truth table33%1/3
A || B
A= $realclean->{'FILES'}B= ()
| |||||||||||||||||||||||||||||
| 77 | FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), | ||||||||||||||||||||||||||||
| 78 | ); | ||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||
| 80 | 0 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
libs: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 81 | 0 | sub libs { | |||||||||||||||||||||||||||
| 82 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | 0 | my $libs = ref $_[0] ? shift : [ shift ]; | |||||||||||||||||||||||||||
| 84 | $self->makemaker_args( LIBS => $libs ); | ||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||
| 86 | 0 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
inc: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 87 | 0 | sub inc { | |||||||||||||||||||||||||||
| 88 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 89 | $self->makemaker_args( INC => shift ); | ||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||
| 91 | 1 | ||||||||||||||||||||||||||||
| 92 | my %test_dir = (); | ||||||||||||||||||||||||||||
| 93 | 0 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
_wanted_t: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 94 | 0 | ▶ | sub _wanted_t { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
/\.t$/ and -f $_
MC/DC0%0/2
/\.t$/ and -f $_
/\.t$/
-f $_
Truth table0%0/3
A and B
A= /\.t$/B= -f $_
| |||||||||||||||||||||||||||||
| 95 | /\.t$/ and -f $_ and $test_dir{$File::Find::dir} = 1; | ||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||
| 97 | 0 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
tests_recursive: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 98 | 0 | sub tests_recursive { | |||||||||||||||||||||||||||
| 99 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 100 | 0 | if ( $self->tests ) { | |||||||||||||||||||||||||||
| 101 | die "tests_recursive will not work if tests are already defined"; | ||||||||||||||||||||||||||||
| 102 | 0 | ▶ | } | ||||||||||||||||||||||||||
|
Condition0%0/2
shift() || 't'
MC/DC0%0/1
shift() || 't'
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 103 | 0 | ▶ | my $dir = shift || 't'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 104 | 0 | unless ( -d $dir ) { | |||||||||||||||||||||||||||
| 105 | die "tests_recursive dir '$dir' does not exist"; | ||||||||||||||||||||||||||||
| 106 | 0 | } | |||||||||||||||||||||||||||
| 107 | 0 | %test_dir = (); | |||||||||||||||||||||||||||
| 108 | 0 | require File::Find; | |||||||||||||||||||||||||||
| 109 | 0 | File::Find::find( \&_wanted_t, $dir ); | |||||||||||||||||||||||||||
| 110 | $self->tests( join ' ', map { "$_/*.t" } sort keys %test_dir ); | ||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||
| 112 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
write: called CC=23 SCAR=38.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 113 | 1 | sub write { | |||||||||||||||||||||||||||
| 114 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 115 | die "&Makefile->write() takes no arguments\n" if @_; | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | 1 | # Check the current Perl version | |||||||||||||||||||||||||||
| 118 | 1 | ▶ | my $perl_version = $self->perl_version; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 119 | 1 | ▶ | if ( $perl_version ) { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.1
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 120 | eval "use $perl_version; 1" | ||||||||||||||||||||||||||||
| 121 | or die "ERROR: perl: Version $] is installed, " | ||||||||||||||||||||||||||||
| 122 | . "but we need version >= $perl_version"; | ||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | 1 | # Make sure we have a new enough MakeMaker | |||||||||||||||||||||||||||
| 126 | require ExtUtils::MakeMaker; | ||||||||||||||||||||||||||||
| 127 | 1 | ▶ | |||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$perl_version and $self->_cmp($perl_version, "5.006") >= 0
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
| |||||||||||||||||||||||||||||
| 128 | if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { | ||||||||||||||||||||||||||||
| 129 | # MakeMaker can complain about module versions that include | ||||||||||||||||||||||||||||
| 130 | # an underscore, even though its own version may contain one! | ||||||||||||||||||||||||||||
| 131 | # Hence the funny regexp to get rid of it. See RT #35800 | ||||||||||||||||||||||||||||
| 132 | 0 | # for details. | |||||||||||||||||||||||||||
| 133 | 0 | $self->build_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ ); | |||||||||||||||||||||||||||
| 134 | $self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ ); | ||||||||||||||||||||||||||||
| 135 | } else { | ||||||||||||||||||||||||||||
| 136 | # Allow legacy-compatibility with 5.005 by depending on the | ||||||||||||||||||||||||||||
| 137 | 1 | # most recent EU:MM that supported 5.005. | |||||||||||||||||||||||||||
| 138 | 1 | $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 ); | |||||||||||||||||||||||||||
| 139 | $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 ); | ||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | 1 | # Generate the MakeMaker params | |||||||||||||||||||||||||||
| 143 | 1 | my $args = $self->makemaker_args; | |||||||||||||||||||||||||||
| 144 | 1 | ▶ | $args->{DISTNAME} = $self->name; | ||||||||||||||||||||||||||
|
Condition33%1/3
$self->module_name || $self->name
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
| |||||||||||||||||||||||||||||
| 145 | 1 | $args->{NAME} = $self->module_name || $self->name; | |||||||||||||||||||||||||||
| 146 | 1 | $args->{VERSION} = $self->version; | |||||||||||||||||||||||||||
| 147 | 1 | ▶ | $args->{NAME} =~ s/-/::/g; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 148 | 1 | if ( $self->tests ) { | |||||||||||||||||||||||||||
| 149 | $args->{test} = { TESTS => $self->tests }; | ||||||||||||||||||||||||||||
| 150 | 1 | ▶ | } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 151 | 1 | if ( $] >= 5.005 ) { | |||||||||||||||||||||||||||
| 152 | 1 | $args->{ABSTRACT} = $self->abstract; | |||||||||||||||||||||||||||
| 153 | $args->{AUTHOR} = $self->author; | ||||||||||||||||||||||||||||
| 154 | 1 | ▶ | } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 155 | 1 | if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) { | |||||||||||||||||||||||||||
| 156 | $args->{NO_META} = 1; | ||||||||||||||||||||||||||||
| 157 | 1 | ▶ | } | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
eval $ExtUtils::MakeMaker::VERSION > "6.17" and $self->sign
MC/DC0%0/2
eval $ExtUtils::MakeMaker::VERSION > "6.17" and $self->sign
eval $ExtUtils::MakeMaker::VERSION > "6.17"
$self->sign
Truth table33%1/3
A and B
A= eval $ExtUtils::MakeMaker::VERSION > "6.17"B= $self->sign
| |||||||||||||||||||||||||||||
| 158 | 0 | if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 and $self->sign ) { | |||||||||||||||||||||||||||
| 159 | $args->{SIGN} = 1; | ||||||||||||||||||||||||||||
| 160 | 1 | ▶ | } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 161 | 1 | unless ( $self->is_admin ) { | |||||||||||||||||||||||||||
| 162 | delete $args->{SIGN}; | ||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 1 | ▶ | # Merge both kinds of requires into prereq_pm | ||||||||||||||||||||||||||
|
Condition50%1/2
$args->{"PREREQ_PM"} ||= {}
MC/DC0%0/1
$args->{"PREREQ_PM"} ||= {}
$args->{"PREREQ_PM"}
Truth table50%1/2
A
A= $args->{"PREREQ_PM"}
| |||||||||||||||||||||||||||||
| 166 | my $prereq = ($args->{PREREQ_PM} ||= {}); | ||||||||||||||||||||||||||||
| 167 | 8 | %$prereq = ( %$prereq, | |||||||||||||||||||||||||||
| 168 | 1 | map { @$_ } | |||||||||||||||||||||||||||
| 169 | map { @$_ } | ||||||||||||||||||||||||||||
| 170 | grep $_, | ||||||||||||||||||||||||||||
| 171 | ($self->configure_requires, $self->build_requires, $self->requires) | ||||||||||||||||||||||||||||
| 172 | ); | ||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | 1 | # Remove any reference to perl, PREREQ_PM doesn't support it | |||||||||||||||||||||||||||
| 175 | delete $args->{PREREQ_PM}->{perl}; | ||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||
| 177 | 1 | ▶ | # merge both kinds of requires into prereq_pm | ||||||||||||||||||||||||||
|
Condition50%1/2
$args->{"DIR"} ||= []
MC/DC0%0/1
$args->{"DIR"} ||= []
$args->{"DIR"}
Truth table50%1/2
A
A= $args->{"DIR"}
| |||||||||||||||||||||||||||||
| 178 | 1 | ▶ | my $subdirs = ($args->{DIR} ||= []); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 179 | 0 | if ($self->bundles) { | |||||||||||||||||||||||||||
| 180 | 0 | foreach my $bundle (@{ $self->bundles }) { | |||||||||||||||||||||||||||
| 181 | 0 | ▶ | my ($file, $dir) = @$bundle; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 182 | 0 | push @$subdirs, $dir if -d $dir; | |||||||||||||||||||||||||||
| 183 | delete $prereq->{$file}; | ||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||
| 186 | 1 | ▶ | |||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 187 | 1 | ▶ | if ( my $perl_version = $self->perl_version ) { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.1
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 188 | eval "use $perl_version; 1" | ||||||||||||||||||||||||||||
| 189 | or die "ERROR: perl: Version $] is installed, " | ||||||||||||||||||||||||||||
| 190 | . "but we need version >= $perl_version"; | ||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||
| 192 | 1 | ||||||||||||||||||||||||||||
| 193 | $args->{INSTALLDIRS} = $self->installdirs; | ||||||||||||||||||||||||||||
| 194 | 1 | ||||||||||||||||||||||||||||
| 195 | my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_})} keys %$args; | ||||||||||||||||||||||||||||
| 196 | 1 | ||||||||||||||||||||||||||||
| 197 | 1 | ▶ | my $user_preop = delete $args{dist}->{PREOP}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 198 | 0 | if (my $preop = $self->admin->preop($user_preop)) { | |||||||||||||||||||||||||||
| 199 | 0 | foreach my $key ( keys %$preop ) { | |||||||||||||||||||||||||||
| 200 | $args{dist}->{$key} = $preop->{$key}; | ||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||
| 203 | 1 | ||||||||||||||||||||||||||||
| 204 | 1 | ▶ | my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); | ||||||||||||||||||||||||||
|
Condition50%1/2
$mm->{'FIRST_MAKEFILE'} || 'Makefile'
MC/DC0%0/1
$mm->{'FIRST_MAKEFILE'} || 'Makefile'
$mm->{'FIRST_MAKEFILE'}
Truth table50%1/2
A
A= $mm->{'FIRST_MAKEFILE'}
| |||||||||||||||||||||||||||||
| 205 | $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); | ||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||
| 207 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
fix_up_makefile: called CC=10 SCAR=24.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 208 | 1 | sub fix_up_makefile { | |||||||||||||||||||||||||||
| 209 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 210 | 1 | ▶ | my $makefile_name = shift; | ||||||||||||||||||||||||||
|
Condition50%1/2
ref $self->_top || ''
MC/DC0%0/1
ref $self->_top || ''
ref $self->_top
Truth table50%1/2
A
A= ref $self->_top
| |||||||||||||||||||||||||||||
| 211 | 1 | ▶ | my $top_class = ref($self->_top) || ''; | ||||||||||||||||||||||||||
|
Condition50%1/2
$self->_top->VERSION || ''
MC/DC0%0/1
$self->_top->VERSION || ''
$self->_top->VERSION
Truth table50%1/2
A
A= $self->_top->VERSION
| |||||||||||||||||||||||||||||
| 212 | my $top_version = $self->_top->VERSION || ''; | ||||||||||||||||||||||||||||
| 213 | 1 | ▶ | |||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 214 | my $preamble = $self->preamble | ||||||||||||||||||||||||||||
| 215 | ? "# Preamble by $top_class $top_version\n" | ||||||||||||||||||||||||||||
| 216 | . $self->preamble | ||||||||||||||||||||||||||||
| 217 | 1 | ▶ | : ''; | ||||||||||||||||||||||||||
|
Condition50%1/2
$self->postamble || ''
MC/DC0%0/1
$self->postamble || ''
$self->postamble
Truth table50%1/2
A
A= $self->postamble
| |||||||||||||||||||||||||||||
| 218 | my $postamble = "# Postamble by $top_class $top_version\n" | ||||||||||||||||||||||||||||
| 219 | . ($self->postamble || ''); | ||||||||||||||||||||||||||||
| 220 | 1 | ||||||||||||||||||||||||||||
| 221 | 1 | ▶ | local *MAKEFILE; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 222 | 1 | open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; | |||||||||||||||||||||||||||
| 223 | 1 | ▶ | my $makefile = do { local $/; <MAKEFILE> }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 224 | close MAKEFILE or die $!; | ||||||||||||||||||||||||||||
| 225 | 1 | ||||||||||||||||||||||||||||
| 226 | 1 | $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; | |||||||||||||||||||||||||||
| 227 | 1 | $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; | |||||||||||||||||||||||||||
| 228 | 1 | $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; | |||||||||||||||||||||||||||
| 229 | 1 | $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; | |||||||||||||||||||||||||||
| 230 | $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; | ||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||
| 232 | # Module::Install will never be used to build the Core Perl | ||||||||||||||||||||||||||||
| 233 | # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks | ||||||||||||||||||||||||||||
| 234 | 1 | # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist | |||||||||||||||||||||||||||
| 235 | $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; | ||||||||||||||||||||||||||||
| 236 | #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; | ||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | 1 | # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. | |||||||||||||||||||||||||||
| 239 | $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; | ||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | # XXX - This is currently unused; not sure if it breaks other MM-users | ||||||||||||||||||||||||||||
| 242 | # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; | ||||||||||||||||||||||||||||
| 243 | 1 | ▶ | |||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 244 | 1 | ▶ | open MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 245 | 1 | ▶ | print MAKEFILE "$preamble$makefile$postamble" or die $!; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 246 | close MAKEFILE or die $!; | ||||||||||||||||||||||||||||
| 247 | 1 | ||||||||||||||||||||||||||||
| 248 | 1; | ||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||
| 250 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
preamble: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 251 | 1 | sub preamble { | |||||||||||||||||||||||||||
| 252 | 1 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 253 | 1 | $self->{preamble} = $text . $self->{preamble} if defined $text; | |||||||||||||||||||||||||||
| 254 | $self->{preamble}; | ||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||
| 256 | 1 | ▶ | |||||||||||||||||||||||||||
|
Subroutine
postamble: called CC=3 SCAR=12.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 257 | 1 | sub postamble { | |||||||||||||||||||||||||||
| 258 | 1 | ▶ | my ($self, $text) = @_; | ||||||||||||||||||||||||||
|
Condition33%1/3
$self->{"postamble"} ||= $self->admin->postamble
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
| |||||||||||||||||||||||||||||
| 259 | 1 | ▶ | $self->{postamble} ||= $self->admin->postamble; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 260 | $self->{postamble} .= $text if defined $text; | ||||||||||||||||||||||||||||
| 261 | 1 | $self->{postamble} | |||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||
| 263 | 1 | ||||||||||||||||||||||||||||
| 264 | 1; | ||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||
| 266 | __END__ | ||||||||||||||||||||||||||||