line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XS::Install::Payload; |
2
|
11
|
|
|
11
|
|
84
|
use strict; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
348
|
|
3
|
11
|
|
|
11
|
|
59
|
use warnings; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
252
|
|
4
|
11
|
|
|
11
|
|
55
|
use Cwd(); |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
6122
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my (%module_info, %vcache); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub data_dir { |
9
|
133
|
|
|
133
|
0
|
269
|
my $module = pop; |
10
|
133
|
|
|
|
|
585
|
$module =~ s/::/\//g; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# first try search in loaded module's dir |
13
|
133
|
100
|
|
|
|
624
|
if (my $path = $INC{"$module.pm"}) { |
14
|
102
|
|
|
|
|
533
|
$path =~ s/\.pm$//; |
15
|
102
|
|
|
|
|
228
|
my $pldir = "$path.x"; |
16
|
102
|
50
|
|
|
|
7795
|
return Cwd::realpath($pldir) if -d $pldir; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
31
|
|
|
|
|
137
|
foreach my $inc (@INC) { |
20
|
341
|
|
|
|
|
1063
|
my $pldir = "$inc/$module.x"; |
21
|
341
|
50
|
|
|
|
4867
|
return Cwd::realpath($pldir) if -d $pldir; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
31
|
|
|
|
|
396
|
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
|
102
|
my $data_dir = data_dir(@_) or return undef; |
36
|
31
|
|
|
|
|
133
|
my $dir = "$data_dir/i"; |
37
|
31
|
50
|
|
|
|
535
|
return $dir if -d $dir; |
38
|
0
|
|
|
|
|
0
|
return undef; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub typemap_dir { |
42
|
31
|
50
|
|
31
|
0
|
110
|
my $data_dir = data_dir(@_) or return undef; |
43
|
31
|
|
|
|
|
135
|
my $dir = "$data_dir/tm"; |
44
|
31
|
50
|
|
|
|
513
|
return $dir if -d $dir; |
45
|
0
|
|
|
|
|
0
|
return undef; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub binary_module_info_file { |
49
|
40
|
100
|
|
40
|
0
|
203
|
my $data_dir = data_dir(@_) or return undef; |
50
|
9
|
|
|
|
|
62
|
return "$data_dir/info"; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub binary_module_info { |
54
|
62
|
|
|
62
|
0
|
169
|
my $module = shift; |
55
|
62
|
|
|
|
|
141
|
my $info = $module_info{$module}; |
56
|
62
|
100
|
|
|
|
164
|
unless ($info) { |
57
|
40
|
100
|
|
|
|
124
|
my $file = binary_module_info_file($module) or return undef; |
58
|
9
|
50
|
|
|
|
538
|
return undef unless -f $file; |
59
|
9
|
50
|
|
|
|
3606
|
$info = do($file) or return undef; |
60
|
9
|
50
|
|
|
|
57
|
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
|
|
|
|
|
130
|
return $info; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub loaded_module_version { |
70
|
0
|
|
|
0
|
0
|
|
my $module = shift; |
71
|
11
|
|
|
11
|
|
128
|
no strict 'refs'; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
1291
|
|
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; |