| 1 | package XS::Install::Payload; | ||||||||||||||||||||||||||||
| 2 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 11 | ▶ | use Cwd(); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 11 | my (%module_info, %vcache); | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 133 | ▶ | sub data_dir { | ||||||||||||||||||||||||||
|
Subroutine
data_dir: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 133 | my $module = pop; | |||||||||||||||||||||||||||
| 10 | 133 | $module =~ s/::/\//g; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # first try search in loaded module's dir | ||||||||||||||||||||||||||||
| 13 | 133 | ▶ | if (my $path = $INC{"$module.pm"}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 14 | 102 | $path =~ s/\.pm$//; | |||||||||||||||||||||||||||
| 15 | 102 | my $pldir = "$path.x"; | |||||||||||||||||||||||||||
| 16 | 102 | ▶ | return Cwd::realpath($pldir) if -d $pldir; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 31 | foreach my $inc (@INC) { | |||||||||||||||||||||||||||
| 20 | 248 | my $pldir = "$inc/$module.x"; | |||||||||||||||||||||||||||
| 21 | 248 | ▶ | return Cwd::realpath($pldir) if -d $pldir; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 31 | return undef; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub payload_dir { | ||||||||||||||||||||||||||
|
Subroutine
payload_dir: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | my $data_dir = data_dir(@_) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | 0 | my $dir = "$data_dir/payload"; | |||||||||||||||||||||||||||
| 30 | 0 | ▶ | return $dir if -d $dir; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 0 | return undef; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 31 | ▶ | sub include_dir { | ||||||||||||||||||||||||||
|
Subroutine
include_dir: called CC=3 SCAR=12.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | 31 | ▶ | my $data_dir = data_dir(@_) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 31 | my $dir = "$data_dir/i"; | |||||||||||||||||||||||||||
| 37 | 31 | ▶ | return $dir if -d $dir; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 0 | return undef; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 31 | ▶ | sub typemap_dir { | ||||||||||||||||||||||||||
|
Subroutine
typemap_dir: called CC=3 SCAR=12.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 42 | 31 | ▶ | my $data_dir = data_dir(@_) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 43 | 31 | my $dir = "$data_dir/tm"; | |||||||||||||||||||||||||||
| 44 | 31 | ▶ | return $dir if -d $dir; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 45 | 0 | return undef; | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 40 | ▶ | sub binary_module_info_file { | ||||||||||||||||||||||||||
|
Subroutine
binary_module_info_file: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 49 | 40 | ▶ | my $data_dir = data_dir(@_) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | 9 | return "$data_dir/info"; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 62 | ▶ | sub binary_module_info { | ||||||||||||||||||||||||||
|
Subroutine
binary_module_info: called CC=6 SCAR=18.7
Pod
undocumented
| |||||||||||||||||||||||||||||
| 54 | 62 | my $module = shift; | |||||||||||||||||||||||||||
| 55 | 62 | my $info = $module_info{$module}; | |||||||||||||||||||||||||||
| 56 | 62 | ▶ | unless ($info) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 57 | 40 | ▶ | my $file = binary_module_info_file($module) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 58 | 9 | ▶ | return undef unless -f $file; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 9 | ▶ | $info = do($file) or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | 9 | ▶ | unless (ref($info) eq 'HASH') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | 0 | warn "bad module info file: $file"; | |||||||||||||||||||||||||||
| 62 | 0 | return undef; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | 9 | $module_info{$module} = $info; | |||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | 31 | return $info; | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 0 | ▶ | sub loaded_module_version { | ||||||||||||||||||||||||||
|
Subroutine
loaded_module_version: not called CC=4 SCAR=25.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 70 | 0 | my $module = shift; | |||||||||||||||||||||||||||
| 71 | 11 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 72 | 0 | my $version = ${"${module}::VERSION"}; | |||||||||||||||||||||||||||
| 73 | 0 | ▶ | if (!$version and my $vsub = $module->can('VERSION')) { $version = $module->VERSION } | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $version and my $vsub = $module->can("VERSION")
MC/DC0%0/2
not $version and my $vsub = $module->can("VERSION")
not $version
my $vsub = $module->can("VERSION")
Truth table0%0/3
not(A) and B
A= not $versionB= my $vsub = $module->can("VERSION")
| |||||||||||||||||||||||||||||
| 74 | 0 | ▶ | return $version || 0; | ||||||||||||||||||||||||||
|
Condition0%0/2
$version || 0
MC/DC0%0/1
$version || 0
$version
Truth table0%0/2
A
A= $version
| |||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 11 | 1; | |||||||||||||||||||||||||||