| 1 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # This file is part of ASPEER::MakeMaker. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # Full license text is available at: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | # <http://dev.perl.org/licenses/> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | package ASPEER::MakeMaker::MM::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | # Pragma | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 3 | ▶ | use vars qw($VERSION $DEBUG $QUIET $VERBOSE @EXPORT); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | # External modules | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 3 | ▶ | use FindBin qw($RealBin $Script); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 3 | FindBin::again(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 3 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 3 | ▶ | use File::Spec; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 3 | ▶ | use IO::File; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 3 | local $Data::Dumper::Indent=1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 3 | local $Data::Dumper::Terse=1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 3 | local $Data::Dumper::Sortkeys=1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | # Export functions | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 3 | ▶ | use base 'Exporter'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 3 | @EXPORT=qw(err msg verbose debug quiet_enable verbose_enable debug_enable Dumper slurp blurp touch arg perlrun); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | # Version information in a format suitable for CPAN etc. Must be | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | # all on one line | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 3 | $VERSION='1.011'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | # Debugging on ? | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 3 | $Script=~s/\.pl$//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 3 | ▶ | ($Carp::Verbose=++$DEBUG) if $ENV{uc("${Script}_DEBUG")}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | # Done | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | #================================================================================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | sub quiet_enable { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
quiet_enable: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # Turn on quiet flag | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | $QUIET=shift() || 1; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
shift() || 1
MC/DC0%0/1
shift() || 1
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | sub verbose { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
verbose: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | # Print verbose message | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | return if $QUIET || !$VERBOSE; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ASPEER::MakeMaker::MM::Util::QUIET or not $ASPEER::MakeMaker::MM::Util::VERBOSE
MC/DC0%0/2
$ASPEER::MakeMaker::MM::Util::QUIET or not $ASPEER::MakeMaker::MM::Util::VERBOSE
$ASPEER::MakeMaker::MM::Util::QUIET
not $ASPEER::MakeMaker::MM::Util::VERBOSE
Truth table0%0/3
A or not(B)
A= $ASPEER::MakeMaker::MM::Util::QUIETB= not $ASPEER::MakeMaker::MM::Util::VERBOSE
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | return CORE::print STDERR &fmt(@_), $/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | sub verbose_enable { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
verbose_enable: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | # Turn on verbose flag | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | $VERBOSE=shift() || 1; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
shift() || 1
MC/DC0%0/1
shift() || 1
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | sub debug_enable { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
debug_enable: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | # Turn on debugging flag | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | $DEBUG=shift(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | sub debug { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
debug: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | # Debug | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | $DEBUG || return; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $debug=sprintf(shift(), @_); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | chomp($debug); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | my ($package, undef, $line, $method) = caller(1); # '1' for caller of the function | |||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | print STDERR sprintf("[%s:%d] %s$/", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | join('::', grep {$_} ($package, $method)), | |||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | $line, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | $debug | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 2 | ▶ | sub err { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
err: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | # Quit on errors | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 2 | my $msg=&fmt('error: %s', @_); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 2 | CORE::print STDERR $msg, "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 2 | eval {require Carp; 1}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 2 | Carp::croak; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 7 | ▶ | sub fmt { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fmt: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | # Format message nicely. Always called by err or msg so caller=2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 7 | my $message=sprintf(shift(), @_); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 7 | chomp($message); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 7 | my @caller=(caller(2)); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 7 | ▶ | my $caller=$caller[3] || $caller[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$caller[3] || $caller[0]
MC/DC0%0/2
$caller[3] || $caller[0]
$caller[3]
$caller[0]
Truth table33%1/3
A || B
A= $caller[3]B= $caller[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 7 | my ($class, $method)=($caller=~/^(.*)::([^:]+)$/); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 7 | ▶ | $method ||=$caller[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$method ||= $caller[0]
MC/DC0%0/2
$method ||= $caller[0]
$method
$caller[0]
Truth table33%1/3
A ||= B
A= $methodB= $caller[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 7 | $caller=~s/^_?!(_)//; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 7 | my $format=' @<<<<<<<<<<<<<<<<<< @*'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 7 | local $^A=''; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 7 | formline $format, "[$method]", $message; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 7 | return $^A; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 5 | ▶ | sub msg { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
msg: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | # Print message | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 5 | ▶ | return (CORE::print STDERR &fmt(@_), $/) unless $QUIET; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 3 | ▶ | sub slurp { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
slurp: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | # Slurp in file content | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 3 | my ($fn)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 3 | ▶ | my $fh=IO::File->new($fn, 'r') || | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
'IO::File'->new($fn, 'r') || (return err("unable to open file $fn, $!"))
MC/DC0%0/1
'IO::File'->new($fn, 'r') || (return err("unable to open file $fn, $!"))
'IO::File'->new($fn, 'r')
Truth table50%1/2
A
A= 'IO::File'->new($fn, 'r')
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | return err("unable to open file $fn, $!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 3 | local $/=undef; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 3 | my $text=<$fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 3 | $fh->close(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 3 | ▶ | return $text || ''; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$text || ''
MC/DC0%0/1
$text || ''
$text
Truth table50%1/2
A
A= $text
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 4 | ▶ | sub blurp { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
blurp: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | # Save file content | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 4 | my ($fn, $text)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 4 | ▶ | my $fh=IO::File->new($fn, 'w') || | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
'IO::File'->new($fn, 'w') || (return err("unable to open $fn for write, $!"))
MC/DC0%0/1
'IO::File'->new($fn, 'w') || (return err("unable to open $fn for write, $!"))
'IO::File'->new($fn, 'w')
Truth table50%1/2
A
A= 'IO::File'->new($fn, 'w')
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | return err("unable to open $fn for write, $!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 4 | ▶ | $fh->print($text) || | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | return err("unable to write file $fn, $!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 3 | ▶ | $fh->close() || | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | return err("unable to close file $fn, $!"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 2 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | sub touch { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
touch: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | my ($fn)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | return 1 if -e $fn; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | return blurp($fn, ''); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | sub perlrun { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
perlrun: not called CC=6 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | # Get self ref | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | my ($self, $mm_or)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | # Construct PERL runtime | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | my $perl_inc_ar=&perl_inc; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | # And modules | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | my $perl_mod_ar=&perl_mod; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | my @import_class; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 3 | ▶ | no warnings qw(once); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | @import_class=@MY::ExtUtils_MM_Import_Order; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | @import_class=(ref($self)) unless @import_class; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | my %import_class=map {$_=>1} @import_class; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | my @perl_mod_no_import=grep {!$import_class{$_}} @{$perl_mod_ar}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | my %seen; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | my @perl_mod=grep {!$seen{$_}++} ( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | @perl_mod_no_import, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | @import_class | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | # Now construct final PERLRUN string | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | my $perlrun; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | my $quote_cr=$mm_or && $mm_or->can('quote_literal'); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$mm_or && $mm_or->can('quote_literal')
MC/DC0%0/2
$mm_or && $mm_or->can('quote_literal')
$mm_or
$mm_or->can('quote_literal')
Truth table0%0/3
A && B
A= $mm_orB= $mm_or->can('quote_literal')
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | my $perlrun_inc=join(' ', map { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | my $arg="-I$_"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | $quote_cr ? $quote_cr->($mm_or, $arg) : $arg | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | } @{$perl_inc_ar}); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | my $perlrun_mod=join(' ', map { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | my $class=$_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 3 | ▶ | no warnings qw(once); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | my $import_tag_ar=$MY::ExtUtils_MM_Import_Tag{$class}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | $import_tag_ar && @{$import_tag_ar} ? | |||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | sprintf('-M%s=%s', $class, join(',', @{$import_tag_ar})) : | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$import_tag_ar and @{$import_tag_ar;}
MC/DC0%0/2
$import_tag_ar and @{$import_tag_ar;}
$import_tag_ar
@{$import_tag_ar;}
Truth table0%0/3
A and B
A= $import_tag_arB= @{$import_tag_ar;}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | "-M$class" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | } @perl_mod); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | $perlrun="\$(PERL) $perlrun_inc $perlrun_mod"; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | # And return | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | return $perlrun | |||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | sub perl_mod { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
perl_mod: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | my %seen=( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | __PACKAGE__ => 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | my @m=sort | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | grep { !$seen{$_}++ } | |||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | map {(my $m = $_) =~ s{\.pm$}{}; $m =~ s{/}{::}g; $m;} | |||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | grep { m{^ExtUtils/} } | |||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | keys %INC; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | return \@m; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | sub perl_inc { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
perl_inc: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | # Return array ref of any additional libraries specified via command line (-I) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | my %default_inc=map { $_ => 1 } @{ perl_inc_default() || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
perl_inc_default() || []
MC/DC0%0/1
perl_inc_default() || []
perl_inc_default()
Truth table0%0/2
A
A= perl_inc_default()
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | my %seen; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | my @lib=grep { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | !$default_inc{$_} && !$seen{$_}++ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$default_inc{$_} || $seen{$_}++
MC/DC0%0/2
$default_inc{$_} || $seen{$_}++
$default_inc{$_}
$seen{$_}++
Truth table0%0/3
A || B
A= $default_inc{$_}B= $seen{$_}++
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | } map { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | File::Spec->rel2abs($_) | |||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } grep { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | ▶ | defined($_) && !ref($_) && length($_) && -d $_ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
defined $_ && !ref($_) && length $_ && -d $_
defined $_ and not ref $_ and length $_
defined $_ and not ref $_
MC/DC0%0/4
defined $_ && !ref($_) && length $_ && -d $_
defined $_
not ref $_
length $_
-d $_
Truth table0%0/5
A and not(B) and C && D
A= defined $_B= not ref $_C= length $_D= -d $_
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | } @INC; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | return \@lib; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | ▶ | sub perl_inc_default { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
perl_inc_default: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | my @default_inc; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | if (open(my $perl_fh, '-|', $^X, '-e', 'print join qq(\0), grep { defined && !ref && length && -d } @INC')) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | local $/; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | my $inc=<$perl_fh>; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | close($perl_fh); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | @default_inc=map { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | File::Spec->rel2abs($_) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$inc || ''
MC/DC0%0/1
$inc || ''
$inc
Truth table0%0/2
A
A= $inc
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | } split(/\0/, ($inc || '')); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | return \@default_inc; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 3 | ▶ | sub arg { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
arg: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | # Convert MakeMaker target args to a named parameter hash. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 3 | my (%param, @argv); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 3 | (@param{qw( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | NAME_SYM | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | DISTNAME | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | DISTVNAME | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | VERSION | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | VERSION_SYM | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | VERSION_FROM | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | LICENSE AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | TO_INST_PM | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | EXE_FILES | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | DIST_DEFAULT_TARGET | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | SUFFIX | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | ABSTRACT_FROM | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | )}, @argv)=@_; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 3 | $param{'TO_INST_PM_AR'}=[split /\s+/, $param{'TO_INST_PM'}]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 3 | $param{'EXE_FILES_AR'}=[split /\s+/, $param{'EXE_FILES'}]; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 3 | $param{'ARGV_AR'}=\@argv; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 3 | return \%param | |||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||