| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package XS::Install::Payload; |
|
2
|
11
|
|
|
11
|
|
81
|
use strict; |
|
|
11
|
|
|
|
|
23
|
|
|
|
11
|
|
|
|
|
330
|
|
|
3
|
11
|
|
|
11
|
|
57
|
use warnings; |
|
|
11
|
|
|
|
|
20
|
|
|
|
11
|
|
|
|
|
264
|
|
|
4
|
11
|
|
|
11
|
|
54
|
use Cwd(); |
|
|
11
|
|
|
|
|
20
|
|
|
|
11
|
|
|
|
|
5586
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my (%module_info, %vcache); |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub data_dir { |
|
9
|
133
|
|
|
133
|
0
|
239
|
my $module = pop; |
|
10
|
133
|
|
|
|
|
523
|
$module =~ s/::/\//g; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# first try search in loaded module's dir |
|
13
|
133
|
100
|
|
|
|
486
|
if (my $path = $INC{"$module.pm"}) { |
|
14
|
102
|
|
|
|
|
513
|
$path =~ s/\.pm$//; |
|
15
|
102
|
|
|
|
|
222
|
my $pldir = "$path.x"; |
|
16
|
102
|
50
|
|
|
|
8916
|
return Cwd::realpath($pldir) if -d $pldir; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
31
|
|
|
|
|
101
|
foreach my $inc (@INC) { |
|
20
|
341
|
|
|
|
|
983
|
my $pldir = "$inc/$module.x"; |
|
21
|
341
|
50
|
|
|
|
3945
|
return Cwd::realpath($pldir) if -d $pldir; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
31
|
|
|
|
|
330
|
return undef; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub payload_dir { |
|
28
|
0
|
0
|
|
0
|
1
|
0
|
my $data_dir = data_dir(@_) or return undef; |
|
29
|
0
|
|
|
|
|
0
|
my $dir = "$data_dir/payload"; |
|
30
|
0
|
0
|
|
|
|
0
|
return $dir if -d $dir; |
|
31
|
0
|
|
|
|
|
0
|
return undef; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub include_dir { |
|
35
|
31
|
50
|
|
31
|
0
|
89
|
my $data_dir = data_dir(@_) or return undef; |
|
36
|
31
|
|
|
|
|
119
|
my $dir = "$data_dir/i"; |
|
37
|
31
|
50
|
|
|
|
560
|
return $dir if -d $dir; |
|
38
|
0
|
|
|
|
|
0
|
return undef; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub typemap_dir { |
|
42
|
31
|
50
|
|
31
|
0
|
77
|
my $data_dir = data_dir(@_) or return undef; |
|
43
|
31
|
|
|
|
|
120
|
my $dir = "$data_dir/tm"; |
|
44
|
31
|
50
|
|
|
|
600
|
return $dir if -d $dir; |
|
45
|
0
|
|
|
|
|
0
|
return undef; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub binary_module_info_file { |
|
49
|
40
|
100
|
|
40
|
0
|
118
|
my $data_dir = data_dir(@_) or return undef; |
|
50
|
9
|
|
|
|
|
59
|
return "$data_dir/info"; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub binary_module_info { |
|
54
|
62
|
|
|
62
|
0
|
120
|
my $module = shift; |
|
55
|
62
|
|
|
|
|
121
|
my $info = $module_info{$module}; |
|
56
|
62
|
100
|
|
|
|
148
|
unless ($info) { |
|
57
|
40
|
100
|
|
|
|
129
|
my $file = binary_module_info_file($module) or return undef; |
|
58
|
9
|
50
|
|
|
|
167
|
return undef unless -f $file; |
|
59
|
9
|
50
|
|
|
|
3716
|
$info = do($file) or return undef; |
|
60
|
9
|
50
|
|
|
|
46
|
unless (ref($info) eq 'HASH') { |
|
61
|
0
|
|
|
|
|
0
|
warn "bad module info file: $file"; |
|
62
|
0
|
|
|
|
|
0
|
return undef; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
9
|
|
|
|
|
30
|
$module_info{$module} = $info; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
31
|
|
|
|
|
114
|
return $info; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub loaded_module_version { |
|
70
|
0
|
|
|
0
|
0
|
|
my $module = shift; |
|
71
|
11
|
|
|
11
|
|
89
|
no strict 'refs'; |
|
|
11
|
|
|
|
|
22
|
|
|
|
11
|
|
|
|
|
1193
|
|
|
72
|
0
|
|
|
|
|
|
my $version = ${"${module}::VERSION"}; |
|
|
0
|
|
|
|
|
|
|
|
73
|
0
|
0
|
0
|
|
|
|
if (!$version and my $vsub = $module->can('VERSION')) { $version = $module->VERSION } |
|
|
0
|
|
|
|
|
|
|
|
74
|
0
|
|
0
|
|
|
|
return $version || 0; |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |