line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Build::Built; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
68956
|
use strict; |
|
4
|
|
|
|
|
17
|
|
|
4
|
|
|
|
|
126
|
|
4
|
4
|
|
|
4
|
|
33
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
120
|
|
5
|
4
|
|
|
4
|
|
671
|
use utf8; |
|
4
|
|
|
|
|
22
|
|
|
4
|
|
|
|
|
27
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
145
|
use 5.008001; |
|
4
|
|
|
|
|
14
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.32'; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
24
|
use Carp (); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
97
|
|
11
|
4
|
|
|
4
|
|
511
|
use File::Spec::Functions qw( catdir catfile ); |
|
4
|
|
|
|
|
828
|
|
|
4
|
|
|
|
|
3143
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub run_env { |
14
|
2
|
|
|
2
|
1
|
872
|
my ( $self, @args ) = @_; |
15
|
2
|
|
|
|
|
4
|
my $config = {}; |
16
|
2
|
50
|
|
|
|
8
|
if ( ref $args[0] eq 'HASH' ) { |
17
|
0
|
|
|
|
|
0
|
$config = %{ shift @args }; |
|
0
|
|
|
|
|
0
|
|
18
|
|
|
|
|
|
|
} |
19
|
2
|
100
|
66
|
|
|
28
|
if ( $args[0] and ref $args[0] eq 'CODE' ) { |
20
|
1
|
|
|
|
|
7
|
$config->{code} = shift @args; |
21
|
|
|
|
|
|
|
} |
22
|
2
|
100
|
|
|
|
7
|
if (@args) { |
23
|
1
|
|
|
|
|
166
|
Carp::croak( '->run_env(\%config,\&code)' |
24
|
|
|
|
|
|
|
. ' or ->run_env(\&code)' |
25
|
|
|
|
|
|
|
. ' or ->run_env(\%config)' ); |
26
|
|
|
|
|
|
|
} |
27
|
1
|
|
|
|
|
4
|
local $ENV{PATH} = $self->combined_bin_path; |
28
|
1
|
|
|
|
|
4
|
my $combined_man_path = $self->combined_man_path; |
29
|
1
|
50
|
|
|
|
3
|
local $ENV{MANPATH} = $combined_man_path if $combined_man_path; |
30
|
1
|
|
|
|
|
8
|
delete local $ENV{PERL5LIB}; |
31
|
1
|
|
|
|
|
5
|
return $config->{code}->(); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
1
|
|
|
1
|
1
|
827
|
my ( $self, $args ) = @_; |
36
|
1
|
50
|
|
|
|
4
|
$args = {} unless defined $args; |
37
|
1
|
50
|
|
|
|
5
|
Carp::croak '->new(\%config) required' if not ref $args eq 'HASH'; |
38
|
|
|
|
|
|
|
Carp::croak 'installed_path is a mandatory parameter' |
39
|
1
|
50
|
|
|
|
3
|
unless exists $args->{installed_path}; |
40
|
1
|
|
|
|
|
4
|
return bless $args, $self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub installed_path { |
44
|
0
|
|
|
0
|
1
|
0
|
return $_[0]->{installed_path}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub bin_path { |
48
|
1
|
|
|
1
|
1
|
34
|
return catdir( $_[0]->{installed_path}, 'bin' ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub man_path { |
52
|
2
|
|
|
2
|
1
|
89
|
return catdir( $_[0]->{installed_path}, 'man' ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub combined_bin_path { |
56
|
1
|
|
|
1
|
1
|
3
|
return $_[0]->bin_path . ':' . $ENV{PATH}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub combined_man_path { |
60
|
2
|
50
|
|
2
|
1
|
1104
|
if ( -d $_[0]->man_path ) { |
61
|
0
|
|
|
|
|
0
|
return $_[0]->man_path . ':' . $ENV{MANPATH}; |
62
|
|
|
|
|
|
|
} |
63
|
2
|
|
|
|
|
11
|
return $ENV{MANPATH}; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__ |