| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Panda::Install::Payload; |
|
2
|
12
|
|
|
12
|
|
62
|
use strict; |
|
|
12
|
|
|
|
|
16
|
|
|
|
12
|
|
|
|
|
257
|
|
|
3
|
12
|
|
|
12
|
|
41
|
use warnings; |
|
|
12
|
|
|
|
|
18
|
|
|
|
12
|
|
|
|
|
206
|
|
|
4
|
12
|
|
|
12
|
|
42
|
use Cwd(); |
|
|
12
|
|
|
|
|
16
|
|
|
|
12
|
|
|
|
|
4894
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my %module_info; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub data_dir { |
|
9
|
34
|
|
|
34
|
0
|
51
|
my $module = pop; |
|
10
|
34
|
|
|
|
|
67
|
$module =~ s/::/\//g; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# first try search in loaded module's dir |
|
13
|
34
|
50
|
|
|
|
113
|
if (my $path = $INC{"$module.pm"}) { |
|
14
|
0
|
|
|
|
|
0
|
$path =~ s/\.pm$//; |
|
15
|
0
|
|
|
|
|
0
|
my $pldir = "$path.x"; |
|
16
|
0
|
0
|
|
|
|
0
|
return Cwd::realpath($pldir) if -d $pldir; |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
34
|
|
|
|
|
63
|
foreach my $inc (@INC) { |
|
20
|
374
|
|
|
|
|
839
|
my $pldir = "$inc/$module.x"; |
|
21
|
374
|
50
|
|
|
|
2962
|
return Cwd::realpath($pldir) if -d $pldir; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
34
|
|
|
|
|
286
|
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
|
0
|
0
|
|
0
|
0
|
0
|
my $data_dir = data_dir(@_) or return undef; |
|
36
|
0
|
|
|
|
|
0
|
my $dir = "$data_dir/i"; |
|
37
|
0
|
0
|
|
|
|
0
|
return $dir if -d $dir; |
|
38
|
0
|
|
|
|
|
0
|
return undef; |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub typemap_dir { |
|
42
|
0
|
0
|
|
0
|
0
|
0
|
my $data_dir = data_dir(@_) or return undef; |
|
43
|
0
|
|
|
|
|
0
|
my $dir = "$data_dir/tm"; |
|
44
|
0
|
0
|
|
|
|
0
|
return $dir if -d $dir; |
|
45
|
0
|
|
|
|
|
0
|
return undef; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub module_info_file { |
|
49
|
34
|
50
|
|
34
|
0
|
70
|
my $data_dir = data_dir(@_) or return undef; |
|
50
|
0
|
|
|
|
|
0
|
return "$data_dir/info"; |
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub module_info { |
|
54
|
34
|
|
|
34
|
0
|
63
|
my $module = shift; |
|
55
|
34
|
|
|
|
|
58
|
my $info = $module_info{$module}; |
|
56
|
34
|
50
|
|
|
|
86
|
unless ($info) { |
|
57
|
34
|
50
|
|
|
|
74
|
my $file = module_info_file($module) or return undef; |
|
58
|
0
|
0
|
|
|
|
|
return undef unless -f $file; |
|
59
|
0
|
0
|
|
|
|
|
$info = require $file or return undef; |
|
60
|
0
|
|
|
|
|
|
$module_info{$module} = $info; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
0
|
|
|
|
|
|
return $info; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub module_version { |
|
66
|
0
|
|
|
0
|
0
|
|
my $module = shift; |
|
67
|
0
|
|
|
|
|
|
my $path = $module; |
|
68
|
0
|
|
|
|
|
|
$path =~ s!::!/!g; |
|
69
|
0
|
0
|
|
|
|
|
eval { require $path.".pm"; } or return 0; |
|
|
0
|
|
|
|
|
|
|
|
70
|
12
|
|
|
12
|
|
84
|
no strict 'refs'; |
|
|
12
|
|
|
|
|
32
|
|
|
|
12
|
|
|
|
|
972
|
|
|
71
|
0
|
|
|
|
|
|
my $v = ${$module."::VERSION"}; |
|
|
0
|
|
|
|
|
|
|
|
72
|
0
|
0
|
0
|
|
|
|
if (!$v and my $vsub = $module->can('VERSION')) { |
|
73
|
0
|
|
|
|
|
|
$v = $module->VERSION; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
0
|
|
0
|
|
|
|
return $v || 0; |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |