line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FFI::Platypus::ShareConfig; |
2
|
|
|
|
|
|
|
|
3
|
61
|
|
|
61
|
|
563518
|
use strict; |
|
61
|
|
|
|
|
114
|
|
|
61
|
|
|
|
|
1720
|
|
4
|
61
|
|
|
61
|
|
359
|
use warnings; |
|
61
|
|
|
|
|
207
|
|
|
61
|
|
|
|
|
1564
|
|
5
|
61
|
|
|
61
|
|
840
|
use 5.008004; |
|
61
|
|
|
|
|
338
|
|
6
|
61
|
|
|
61
|
|
309
|
use File::Spec; |
|
61
|
|
|
|
|
110
|
|
|
61
|
|
|
|
|
18952
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '2.07'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub dist_dir ($) |
11
|
|
|
|
|
|
|
{ |
12
|
558
|
|
|
558
|
0
|
1137
|
my($dist_name) = @_; |
13
|
|
|
|
|
|
|
|
14
|
558
|
|
|
|
|
1586
|
my @pm = split /-/, $dist_name; |
15
|
558
|
|
|
|
|
1023
|
$pm[-1] .= ".pm"; |
16
|
|
|
|
|
|
|
|
17
|
558
|
|
|
|
|
1212
|
foreach my $inc (@INC) |
18
|
|
|
|
|
|
|
{ |
19
|
1165
|
100
|
|
|
|
22902
|
if(-f File::Spec->catfile($inc, @pm)) |
20
|
|
|
|
|
|
|
{ |
21
|
558
|
|
|
|
|
3904
|
my $share = File::Spec->catdir($inc, qw( auto share dist ), $dist_name ); |
22
|
558
|
50
|
|
|
|
6454
|
if(-d $share) |
23
|
|
|
|
|
|
|
{ |
24
|
558
|
|
|
|
|
10092
|
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
|
37038
|
my(undef, $name) = @_; |
35
|
517
|
|
|
|
|
708
|
my $config; |
36
|
|
|
|
|
|
|
|
37
|
517
|
50
|
|
|
|
1017
|
unless($config) |
38
|
|
|
|
|
|
|
{ |
39
|
517
|
|
|
|
|
1024
|
my $fn = File::Spec->catfile(dist_dir('FFI-Platypus'), 'config.pl'); |
40
|
517
|
50
|
|
|
|
2554
|
$fn = File::Spec->rel2abs($fn) unless File::Spec->file_name_is_absolute($fn); |
41
|
517
|
|
|
|
|
832
|
local $@; |
42
|
517
|
50
|
|
|
|
123779
|
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
|
|
|
|
5547
|
defined $name ? $config->{$name} : $config; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |