line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPAN::Smoker::Utils::PerlConfig; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1130
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
4
|
1
|
|
|
1
|
|
14
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
5
|
1
|
|
|
1
|
|
23
|
use Config; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
78
|
|
6
|
1
|
|
|
1
|
|
1408
|
use Hash::Util qw(lock_hash); |
|
1
|
|
|
|
|
4590
|
|
|
1
|
|
|
|
|
12
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 'v1.0.1'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=pod |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
CPAN::Smoker::Utils::PerlConfig - class representing a perl configuration |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use CPAN::Smoker::Utils::PerlConfig; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $cfg = CPAN::Smoker::Utils::PerlConfig->new; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This class represents a C configuration in a way that can be used by the |
25
|
|
|
|
|
|
|
C CLI. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
It was created to handle the details of a distroprefs implementation, specially |
28
|
|
|
|
|
|
|
regarding dealing with C values. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 METHODS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 new |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Creates a new instance of this class. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Expects nothing, returns a new instance. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
41
|
1
|
|
|
1
|
1
|
1053
|
my $class = shift; |
42
|
|
|
|
|
|
|
my $self = { |
43
|
|
|
|
|
|
|
osname => $Config{osname}, |
44
|
|
|
|
|
|
|
archname => $Config{archname} |
45
|
1
|
|
|
|
|
8
|
}; |
46
|
1
|
|
|
|
|
3
|
my $attrib_name = 'useithreads'; |
47
|
|
|
|
|
|
|
|
48
|
1
|
50
|
|
|
|
5
|
if ( defined( $Config{$attrib_name} ) ) { |
49
|
0
|
|
|
|
|
0
|
$self->{$attrib_name} = 1; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else { |
52
|
1
|
|
|
|
|
3
|
$self->{$attrib_name} = 0; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
2
|
bless $self, $class; |
56
|
1
|
|
|
|
|
2
|
lock_hash( %{$self} ); |
|
1
|
|
|
|
|
7
|
|
57
|
1
|
|
|
|
|
26
|
return $self; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 dump |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This methods returns a instance attributes as a hash reference. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This is particulary useful to use with YAML modules C function. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub dump { |
69
|
1
|
|
|
1
|
1
|
5
|
my $self = shift; |
70
|
1
|
|
|
|
|
1
|
my %attribs = %{$self}; |
|
1
|
|
|
|
|
4
|
|
71
|
1
|
|
|
|
|
2
|
my $attrib_name = 'useithreads'; |
72
|
|
|
|
|
|
|
|
73
|
1
|
50
|
|
|
|
3
|
if ( $self->{$attrib_name} ) { |
74
|
0
|
|
|
|
|
0
|
$attribs{$attrib_name} = 'define'; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
else { |
77
|
1
|
|
|
|
|
3
|
$attribs{$attrib_name} = '^$'; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
1
|
|
|
|
|
4
|
return \%attribs; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SEE ALSO |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=over |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 AUTHOR |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Alceu Rodrigues de Freitas Junior, Earfreitas@cpan.orgE |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
This software is copyright (c) 2017 of Alceu Rodrigues de Freitas Junior, |
100
|
|
|
|
|
|
|
arfreitas@cpan.org |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This file is part of CPAN Smoker Utils. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
CPAN Smoker Utils is free software: you can redistribute it and/or modify |
105
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
106
|
|
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or |
107
|
|
|
|
|
|
|
(at your option) any later version. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
CPAN Smoker Utils is distributed in the hope that it will be useful, |
110
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
111
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
112
|
|
|
|
|
|
|
GNU General Public License for more details. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
115
|
|
|
|
|
|
|
along with CPAN Smoker Utils. If not, see L. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
1; |