line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Config::BuildHelper; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
21091
|
use base qw(Data::Classifier); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1015
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
19038
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
23
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
1120
|
use Data::Dumper; |
|
1
|
|
|
|
|
8765
|
|
|
1
|
|
|
|
|
120
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub return_result { |
13
|
4
|
|
|
4
|
1
|
26769
|
my ($self, $ret) = @_; |
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
|
|
33
|
return Config::BuildHelper::Result->new($ret); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package Config::BuildHelper::Result; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
18
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
21
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
5
|
use base qw(Data::Classifier::Result); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
90
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
6
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
443
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub config_list { |
28
|
4
|
|
|
4
|
|
1157
|
my ($self) = @_; |
29
|
|
|
|
|
|
|
|
30
|
4
|
50
|
|
|
|
14
|
if (defined($self->{QUERY_HASH})) { |
31
|
0
|
|
|
|
|
0
|
return(keys(%{$self->{QUERY_HASH}})); |
|
0
|
|
|
|
|
0
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
|
|
10
|
$self->{QUERY_HASH} = {}; |
35
|
|
|
|
|
|
|
|
36
|
4
|
|
|
|
|
15
|
foreach my $one ($self->attributes('data')) { |
37
|
9
|
|
|
|
|
64
|
my $node_query = $one->{config}; |
38
|
|
|
|
|
|
|
|
39
|
9
|
50
|
|
|
|
21
|
if (ref($node_query) eq 'ARRAY') { |
40
|
9
|
|
|
|
|
14
|
foreach my $one_query (@$node_query) { |
41
|
|
|
|
|
|
|
#copy this to a local variable so when |
42
|
|
|
|
|
|
|
#we shift off of it, it does not effect |
43
|
|
|
|
|
|
|
#everyone else |
44
|
10
|
|
|
|
|
30
|
my @query_list = @$one_query; |
45
|
10
|
|
|
|
|
15
|
my $op = shift(@query_list); |
46
|
|
|
|
|
|
|
|
47
|
10
|
100
|
|
|
|
27
|
if ($op eq 'ADD') { |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
48
|
5
|
|
|
|
|
9
|
$self->config_add(@query_list); |
49
|
|
|
|
|
|
|
} elsif ($op eq 'REMOVE') { |
50
|
1
|
|
|
|
|
4
|
$self->config_remove(@query_list); |
51
|
|
|
|
|
|
|
} elsif ($op eq 'SET') { |
52
|
4
|
|
|
|
|
10
|
$self->config_set(@query_list); |
53
|
|
|
|
|
|
|
} else { |
54
|
0
|
|
|
|
|
0
|
die "unknown OP: $op"; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
4
|
|
|
|
|
7
|
return keys(%{$self->{QUERY_HASH}}); |
|
4
|
|
|
|
|
19
|
|
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub config_add { |
64
|
9
|
|
|
9
|
|
12
|
my $self = shift(@_); |
65
|
9
|
|
|
|
|
12
|
my $query_hash = $self->{QUERY_HASH}; |
66
|
9
|
|
|
|
|
13
|
my @queries = @_; |
67
|
|
|
|
|
|
|
|
68
|
9
|
|
|
|
|
12
|
foreach my $one (@queries) { |
69
|
13
|
|
|
|
|
31
|
$query_hash->{$one} = 1; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
9
|
|
|
|
|
32
|
return 1; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub config_remove { |
76
|
1
|
|
|
1
|
|
2
|
my $self = shift(@_); |
77
|
1
|
|
|
|
|
3
|
my $query_hash = $self->{QUERY_HASH}; |
78
|
1
|
|
|
|
|
2
|
my @queries = @_; |
79
|
|
|
|
|
|
|
|
80
|
1
|
|
|
|
|
2
|
foreach my $one (@queries) { |
81
|
1
|
|
|
|
|
4
|
delete($query_hash->{$one}); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
|
|
3
|
return 1; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub config_set { |
88
|
4
|
|
|
4
|
|
5
|
my $self = shift; |
89
|
4
|
|
|
|
|
7
|
my $query_hash = $self->{QUERY_HASH} = {}; |
90
|
|
|
|
|
|
|
|
91
|
4
|
|
|
|
|
13
|
return $self->config_add(@_); |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__END__ |