line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FFI::Platypus::ShareConfig; |
2
|
|
|
|
|
|
|
|
3
|
61
|
|
|
61
|
|
717161
|
use strict; |
|
61
|
|
|
|
|
396
|
|
|
61
|
|
|
|
|
1946
|
|
4
|
61
|
|
|
61
|
|
333
|
use warnings; |
|
61
|
|
|
|
|
441
|
|
|
61
|
|
|
|
|
1694
|
|
5
|
61
|
|
|
61
|
|
977
|
use 5.008004; |
|
61
|
|
|
|
|
421
|
|
6
|
61
|
|
|
61
|
|
375
|
use File::Spec; |
|
61
|
|
|
|
|
131
|
|
|
61
|
|
|
|
|
24868
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '2.08'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub dist_dir ($) |
11
|
|
|
|
|
|
|
{ |
12
|
558
|
|
|
558
|
0
|
1237
|
my($dist_name) = @_; |
13
|
|
|
|
|
|
|
|
14
|
558
|
|
|
|
|
1908
|
my @pm = split /-/, $dist_name; |
15
|
558
|
|
|
|
|
1206
|
$pm[-1] .= ".pm"; |
16
|
|
|
|
|
|
|
|
17
|
558
|
|
|
|
|
1473
|
foreach my $inc (@INC) |
18
|
|
|
|
|
|
|
{ |
19
|
1165
|
100
|
|
|
|
27771
|
if(-f File::Spec->catfile($inc, @pm)) |
20
|
|
|
|
|
|
|
{ |
21
|
558
|
|
|
|
|
4647
|
my $share = File::Spec->catdir($inc, qw( auto share dist ), $dist_name ); |
22
|
558
|
50
|
|
|
|
7730
|
if(-d $share) |
23
|
|
|
|
|
|
|
{ |
24
|
558
|
|
|
|
|
11877
|
return File::Spec->rel2abs($share); |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
0
|
last; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
0
|
|
|
|
|
0
|
Carp::croak("unable to find dist share directory for $dist_name"); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub get |
33
|
|
|
|
|
|
|
{ |
34
|
517
|
|
|
517
|
0
|
42109
|
my(undef, $name) = @_; |
35
|
517
|
|
|
|
|
772
|
my $config; |
36
|
|
|
|
|
|
|
|
37
|
517
|
50
|
|
|
|
1184
|
unless($config) |
38
|
|
|
|
|
|
|
{ |
39
|
517
|
|
|
|
|
1118
|
my $fn = File::Spec->catfile(dist_dir('FFI-Platypus'), 'config.pl'); |
40
|
517
|
50
|
|
|
|
2989
|
$fn = File::Spec->rel2abs($fn) unless File::Spec->file_name_is_absolute($fn); |
41
|
517
|
|
|
|
|
1075
|
local $@; |
42
|
517
|
50
|
|
|
|
152667
|
unless($config = do $fn) |
43
|
|
|
|
|
|
|
{ |
44
|
0
|
0
|
|
|
|
0
|
die "couldn't parse configuration $fn $@" if $@; |
45
|
0
|
0
|
|
|
|
0
|
die "couldn't do $fn $!" if $!; |
46
|
0
|
|
|
|
|
0
|
die "bad or missing config file $fn"; |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
517
|
100
|
|
|
|
6620
|
defined $name ? $config->{$name} : $config; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |