line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FFI::Platypus::ShareConfig; |
2
|
|
|
|
|
|
|
|
3
|
61
|
|
|
61
|
|
656405
|
use strict; |
|
61
|
|
|
|
|
142
|
|
|
61
|
|
|
|
|
1937
|
|
4
|
61
|
|
|
61
|
|
418
|
use warnings; |
|
61
|
|
|
|
|
235
|
|
|
61
|
|
|
|
|
1802
|
|
5
|
61
|
|
|
61
|
|
1018
|
use 5.008004; |
|
61
|
|
|
|
|
414
|
|
6
|
61
|
|
|
61
|
|
365
|
use File::Spec; |
|
61
|
|
|
|
|
213
|
|
|
61
|
|
|
|
|
24022
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '2.06_01'; # TRIAL VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub dist_dir ($) |
11
|
|
|
|
|
|
|
{ |
12
|
558
|
|
|
558
|
0
|
1298
|
my($dist_name) = @_; |
13
|
|
|
|
|
|
|
|
14
|
558
|
|
|
|
|
1952
|
my @pm = split /-/, $dist_name; |
15
|
558
|
|
|
|
|
1279
|
$pm[-1] .= ".pm"; |
16
|
|
|
|
|
|
|
|
17
|
558
|
|
|
|
|
1461
|
foreach my $inc (@INC) |
18
|
|
|
|
|
|
|
{ |
19
|
1165
|
100
|
|
|
|
27976
|
if(-f File::Spec->catfile($inc, @pm)) |
20
|
|
|
|
|
|
|
{ |
21
|
558
|
|
|
|
|
4531
|
my $share = File::Spec->catdir($inc, qw( auto share dist ), $dist_name ); |
22
|
558
|
50
|
|
|
|
8106
|
if(-d $share) |
23
|
|
|
|
|
|
|
{ |
24
|
558
|
|
|
|
|
11684
|
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
|
39533
|
my(undef, $name) = @_; |
35
|
517
|
|
|
|
|
786
|
my $config; |
36
|
|
|
|
|
|
|
|
37
|
517
|
50
|
|
|
|
1252
|
unless($config) |
38
|
|
|
|
|
|
|
{ |
39
|
517
|
|
|
|
|
1215
|
my $fn = File::Spec->catfile(dist_dir('FFI-Platypus'), 'config.pl'); |
40
|
517
|
50
|
|
|
|
2928
|
$fn = File::Spec->rel2abs($fn) unless File::Spec->file_name_is_absolute($fn); |
41
|
517
|
|
|
|
|
1133
|
local $@; |
42
|
517
|
50
|
|
|
|
153023
|
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
|
|
|
|
6756
|
defined $name ? $config->{$name} : $config; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |