line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Panda::Install::Payload; |
2
|
12
|
|
|
12
|
|
59
|
use strict; |
|
12
|
|
|
|
|
19
|
|
|
12
|
|
|
|
|
263
|
|
3
|
12
|
|
|
12
|
|
48
|
use warnings; |
|
12
|
|
|
|
|
16
|
|
|
12
|
|
|
|
|
4623
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
my %module_info; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub data_dir { |
8
|
34
|
|
|
34
|
0
|
60
|
my $module = pop; |
9
|
34
|
|
|
|
|
75
|
$module =~ s/::/\//g; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# first try search in loaded module's dir |
12
|
34
|
50
|
|
|
|
150
|
if (my $path = $INC{"$module.pm"}) { |
13
|
0
|
|
|
|
|
0
|
$path =~ s/\.pm$//; |
14
|
0
|
|
|
|
|
0
|
my $pldir = "$path.x"; |
15
|
0
|
0
|
|
|
|
0
|
return $pldir if -d $pldir; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
34
|
|
|
|
|
83
|
foreach my $inc (@INC) { |
19
|
374
|
|
|
|
|
767
|
my $pldir = "$inc/$module.x"; |
20
|
374
|
50
|
|
|
|
2304
|
return $pldir if -d $pldir; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
34
|
|
|
|
|
324
|
return undef; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub payload_dir { |
27
|
0
|
0
|
|
0
|
1
|
0
|
my $data_dir = data_dir(@_) or return undef; |
28
|
0
|
|
|
|
|
0
|
my $dir = "$data_dir/payload"; |
29
|
0
|
0
|
|
|
|
0
|
return $dir if -d $dir; |
30
|
0
|
|
|
|
|
0
|
return undef; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub include_dir { |
34
|
0
|
0
|
|
0
|
0
|
0
|
my $data_dir = data_dir(@_) or return undef; |
35
|
0
|
|
|
|
|
0
|
my $dir = "$data_dir/i"; |
36
|
0
|
0
|
|
|
|
0
|
return $dir if -d $dir; |
37
|
0
|
|
|
|
|
0
|
return undef; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub typemap_dir { |
41
|
0
|
0
|
|
0
|
0
|
0
|
my $data_dir = data_dir(@_) or return undef; |
42
|
0
|
|
|
|
|
0
|
my $dir = "$data_dir/tm"; |
43
|
0
|
0
|
|
|
|
0
|
return $dir if -d $dir; |
44
|
0
|
|
|
|
|
0
|
return undef; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub module_info_file { |
48
|
34
|
50
|
|
34
|
0
|
95
|
my $data_dir = data_dir(@_) or return undef; |
49
|
0
|
|
|
|
|
0
|
return "$data_dir/info"; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub module_info { |
53
|
34
|
|
|
34
|
0
|
71
|
my $module = shift; |
54
|
34
|
|
|
|
|
65
|
my $info = $module_info{$module}; |
55
|
34
|
50
|
|
|
|
90
|
unless ($info) { |
56
|
34
|
50
|
|
|
|
99
|
my $file = module_info_file($module) or return undef; |
57
|
0
|
0
|
|
|
|
|
return undef unless -f $file; |
58
|
0
|
0
|
|
|
|
|
$info = require $file or return undef; |
59
|
0
|
|
|
|
|
|
$module_info{$module} = $info; |
60
|
|
|
|
|
|
|
} |
61
|
0
|
|
|
|
|
|
return $info; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub module_version { |
65
|
0
|
|
|
0
|
0
|
|
my $module = shift; |
66
|
0
|
|
|
|
|
|
my $path = $module; |
67
|
0
|
|
|
|
|
|
$path =~ s!::!/!g; |
68
|
0
|
0
|
|
|
|
|
eval { require $path.".pm"; } or return 0; |
|
0
|
|
|
|
|
|
|
69
|
12
|
|
|
12
|
|
73
|
no strict 'refs'; |
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
837
|
|
70
|
0
|
|
|
|
|
|
my $v = ${$module."::VERSION"}; |
|
0
|
|
|
|
|
|
|
71
|
0
|
0
|
0
|
|
|
|
if (!$v and my $vsub = $module->can('VERSION')) { |
72
|
0
|
|
|
|
|
|
$v = $module->VERSION; |
73
|
|
|
|
|
|
|
} |
74
|
0
|
|
0
|
|
|
|
return $v || 0; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |