line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Build::Config; |
2
|
|
|
|
|
|
|
|
3
|
296
|
|
|
296
|
|
2026
|
use strict; |
|
296
|
|
|
|
|
590
|
|
|
296
|
|
|
|
|
8299
|
|
4
|
296
|
|
|
296
|
|
1532
|
use warnings; |
|
296
|
|
|
|
|
567
|
|
|
296
|
|
|
|
|
15145
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.42_35'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
296
|
|
|
296
|
|
2050
|
use Config; |
|
296
|
|
|
|
|
579
|
|
|
296
|
|
|
|
|
120476
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1050
|
|
|
1050
|
0
|
13105
|
my ($pack, %args) = @_; |
11
|
|
|
|
|
|
|
return bless { |
12
|
|
|
|
|
|
|
stack => {}, |
13
|
|
|
|
|
|
|
values => $args{values} || {}, |
14
|
1050
|
|
50
|
|
|
25323
|
}, $pack; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get { |
18
|
18920
|
|
|
18920
|
0
|
125421
|
my ($self, $key) = @_; |
19
|
18920
|
100
|
100
|
|
|
71630
|
return $self->{values}{$key} if ref($self) && exists $self->{values}{$key}; |
20
|
15806
|
|
|
|
|
299448
|
return $Config{$key}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub set { |
24
|
0
|
|
|
0
|
0
|
0
|
my ($self, $key, $val) = @_; |
25
|
0
|
|
|
|
|
0
|
$self->{values}{$key} = $val; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub push { |
29
|
3
|
|
|
3
|
0
|
12
|
my ($self, $key, $val) = @_; |
30
|
0
|
|
|
|
|
0
|
push @{$self->{stack}{$key}}, $self->{values}{$key} |
31
|
3
|
50
|
|
|
|
48
|
if exists $self->{values}{$key}; |
32
|
3
|
|
|
|
|
60
|
$self->{values}{$key} = $val; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub pop { |
36
|
3
|
|
|
3
|
0
|
4113
|
my ($self, $key) = @_; |
37
|
|
|
|
|
|
|
|
38
|
3
|
|
|
|
|
36
|
my $val = delete $self->{values}{$key}; |
39
|
3
|
50
|
|
|
|
42
|
if ( exists $self->{stack}{$key} ) { |
40
|
0
|
|
|
|
|
0
|
$self->{values}{$key} = pop @{$self->{stack}{$key}}; |
|
0
|
|
|
|
|
0
|
|
41
|
0
|
0
|
|
|
|
0
|
delete $self->{stack}{$key} unless @{$self->{stack}{$key}}; |
|
0
|
|
|
|
|
0
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
3
|
|
|
|
|
21
|
return $val; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub values_set { |
48
|
6
|
|
|
6
|
0
|
35
|
my $self = shift; |
49
|
6
|
50
|
|
|
|
39
|
return undef unless ref($self); |
50
|
6
|
|
|
|
|
51
|
return $self->{values}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub all_config { |
54
|
30
|
|
|
30
|
0
|
92
|
my $self = shift; |
55
|
30
|
50
|
|
|
|
215
|
my $v = ref($self) ? $self->{values} : {}; |
56
|
30
|
|
|
|
|
398496
|
return {%Config, %$v}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |