line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Build::Config; |
2
|
|
|
|
|
|
|
|
3
|
293
|
|
|
293
|
|
2139
|
use strict; |
|
293
|
|
|
|
|
596
|
|
|
293
|
|
|
|
|
8439
|
|
4
|
293
|
|
|
293
|
|
1469
|
use warnings; |
|
293
|
|
|
|
|
896
|
|
|
293
|
|
|
|
|
15160
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.42_33'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
293
|
|
|
293
|
|
2377
|
use Config; |
|
293
|
|
|
|
|
694
|
|
|
293
|
|
|
|
|
127689
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1026
|
|
|
1026
|
0
|
19040
|
my ($pack, %args) = @_; |
11
|
|
|
|
|
|
|
return bless { |
12
|
|
|
|
|
|
|
stack => {}, |
13
|
|
|
|
|
|
|
values => $args{values} || {}, |
14
|
1026
|
|
50
|
|
|
39142
|
}, $pack; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get { |
18
|
21384
|
|
|
21384
|
0
|
53980
|
my ($self, $key) = @_; |
19
|
21384
|
100
|
100
|
|
|
87802
|
return $self->{values}{$key} if ref($self) && exists $self->{values}{$key}; |
20
|
17951
|
|
|
|
|
383377
|
return $Config{$key}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub set { |
24
|
1
|
|
|
1
|
0
|
4
|
my ($self, $key, $val) = @_; |
25
|
1
|
|
|
|
|
5
|
$self->{values}{$key} = $val; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub push { |
29
|
3
|
|
|
3
|
0
|
21
|
my ($self, $key, $val) = @_; |
30
|
0
|
|
|
|
|
0
|
push @{$self->{stack}{$key}}, $self->{values}{$key} |
31
|
3
|
50
|
|
|
|
24
|
if exists $self->{values}{$key}; |
32
|
3
|
|
|
|
|
30
|
$self->{values}{$key} = $val; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub pop { |
36
|
3
|
|
|
3
|
0
|
3576
|
my ($self, $key) = @_; |
37
|
|
|
|
|
|
|
|
38
|
3
|
|
|
|
|
27
|
my $val = delete $self->{values}{$key}; |
39
|
3
|
50
|
|
|
|
45
|
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
|
|
|
|
|
75
|
return $val; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub values_set { |
48
|
6
|
|
|
6
|
0
|
19
|
my $self = shift; |
49
|
6
|
50
|
|
|
|
87
|
return undef unless ref($self); |
50
|
6
|
|
|
|
|
52
|
return $self->{values}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub all_config { |
54
|
30
|
|
|
30
|
0
|
116
|
my $self = shift; |
55
|
30
|
50
|
|
|
|
212
|
my $v = ref($self) ? $self->{values} : {}; |
56
|
30
|
|
|
|
|
429479
|
return {%Config, %$v}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |