line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS::Internals::Constants; |
2
|
|
|
|
|
|
|
|
3
|
0
|
|
|
20
|
|
0
|
use strict; |
|
1
|
|
|
|
|
356
|
|
|
0
|
|
|
|
|
0
|
|
4
|
|
|
|
|
|
|
|
5
|
123
|
|
|
20
|
|
24635
|
use CPANPLUS::Error; |
|
0
|
|
|
|
|
0
|
|
|
3
|
|
|
|
|
207
|
|
6
|
|
|
|
|
|
|
|
7
|
0
|
|
|
20
|
|
0
|
use Config; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
20
|
|
36
|
use File::Spec; |
|
3
|
|
|
|
|
190
|
|
|
0
|
|
|
|
|
0
|
|
9
|
0
|
|
|
20
|
|
0
|
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; |
|
0
|
|
|
|
|
0
|
|
|
8
|
|
|
|
|
96
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require Exporter; |
12
|
8
|
|
|
20
|
|
54
|
use vars qw[$VERSION @ISA @EXPORT]; |
|
7
|
|
|
|
|
606
|
|
|
7
|
|
|
|
|
105
|
|
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
20
|
|
0
|
use Package::Constants; |
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
13
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$VERSION = "0.9912"; |
17
|
|
|
|
|
|
|
@ISA = qw[Exporter]; |
18
|
|
|
|
|
|
|
@EXPORT = Package::Constants->list( __PACKAGE__ ); |
19
|
|
|
|
|
|
|
|
20
|
20
|
|
|
0
|
0
|
132
|
sub constants { @EXPORT }; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
0
|
use constant INSTALLER_BUILD |
23
|
1
|
|
|
20
|
|
18
|
=> 'CPANPLUS::Dist::Build'; |
|
1
|
|
|
|
|
65
|
|
24
|
0
|
|
|
20
|
|
0
|
use constant INSTALLER_MM => 'CPANPLUS::Dist::MM'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
25
|
0
|
|
|
|
|
0
|
use constant INSTALLER_SAMPLE |
26
|
0
|
|
|
20
|
|
0
|
=> 'CPANPLUS::Dist::Sample'; |
|
0
|
|
|
|
|
0
|
|
27
|
0
|
|
|
20
|
|
0
|
use constant INSTALLER_BASE => 'CPANPLUS::Dist::Base'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
28
|
0
|
|
|
|
|
0
|
use constant INSTALLER_AUTOBUNDLE |
29
|
0
|
|
|
20
|
|
0
|
=> 'CPANPLUS::Dist::Autobundle'; |
|
0
|
|
|
|
|
0
|
|
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
20
|
|
0
|
use constant SHELL_DEFAULT => 'CPANPLUS::Shell::Default'; |
|
5
|
|
|
|
|
44
|
|
|
0
|
|
|
|
|
0
|
|
32
|
0
|
|
|
20
|
|
0
|
use constant SHELL_CLASSIC => 'CPANPLUS::Shell::Classic'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
20
|
|
0
|
use constant CONFIG => 'CPANPLUS::Config'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
35
|
0
|
|
|
20
|
|
0
|
use constant CONFIG_USER => 'CPANPLUS::Config::User'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
36
|
0
|
|
|
20
|
|
0
|
use constant CONFIG_SYSTEM => 'CPANPLUS::Config::System'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
37
|
1
|
|
|
20
|
|
51
|
use constant CONFIG_BOXED => 'CPANPLUS::Config::Boxed'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
0
|
use constant DEFAULT_SOURCE_ENGINE |
40
|
0
|
|
|
20
|
|
0
|
=> 'CPANPLUS::Internals::Source::Memory'; |
|
0
|
|
|
|
|
0
|
|
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
20
|
|
0
|
use constant TARGET_INIT => 'init'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
43
|
0
|
|
|
20
|
|
0
|
use constant TARGET_CREATE => 'create'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
44
|
0
|
|
|
20
|
|
0
|
use constant TARGET_PREPARE => 'prepare'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
45
|
0
|
|
|
20
|
|
0
|
use constant TARGET_INSTALL => 'install'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
46
|
0
|
|
|
20
|
|
0
|
use constant TARGET_IGNORE => 'ignore'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
20
|
|
0
|
use constant ON_WIN32 => $^O eq 'MSWin32'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
49
|
0
|
|
|
20
|
|
0
|
use constant ON_NETWARE => $^O eq 'NetWare'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
50
|
0
|
|
|
20
|
|
0
|
use constant ON_CYGWIN => $^O eq 'cygwin'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
51
|
0
|
|
|
20
|
|
0
|
use constant ON_VMS => $^O eq 'VMS'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
52
|
0
|
|
|
20
|
|
0
|
use constant ON_MINIX => $^O eq 'minix'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
20
|
|
0
|
use constant DOT_CPANPLUS => ON_VMS ? '_cpanplus' : '.cpanplus'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
20
|
|
0
|
use constant OPT_AUTOFLUSH => '-MCPANPLUS::Internals::Utils::Autoflush'; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
0
|
use constant UNKNOWN_DL_LOCATION |
59
|
0
|
|
|
20
|
|
0
|
=> 'UNKNOWN-ORIGIN'; |
|
0
|
|
|
|
|
0
|
|
60
|
|
|
|
|
|
|
|
61
|
20
|
|
|
20
|
|
132
|
use constant NMAKE => 'nmake.exe'; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
681
|
|
62
|
20
|
|
|
|
|
1336
|
use constant NMAKE_URL => |
63
|
20
|
|
|
20
|
|
6772
|
'ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe'; |
|
20
|
|
|
|
|
61
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
use constant INSTALL_VIA_PACKAGE_MANAGER |
66
|
20
|
100
|
|
|
|
118
|
=> sub { my $fmt = $_[0] or return; |
67
|
20
|
100
|
33
|
|
|
42
|
return 1 if $fmt ne INSTALLER_BUILD and |
68
|
|
|
|
|
|
|
$fmt ne INSTALLER_MM; |
69
|
20
|
|
|
20
|
|
146
|
}; |
|
20
|
|
|
|
|
40
|
|
|
20
|
|
|
|
|
873
|
|
70
|
|
|
|
|
|
|
|
71
|
20
|
|
|
20
|
|
569
|
use constant IS_CODEREF => sub { ref $_[-1] eq 'CODE' }; |
|
20
|
|
|
|
|
112
|
|
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
103
|
|
72
|
287
|
|
|
|
|
55529
|
use constant IS_MODOBJ => sub { UNIVERSAL::isa($_[-1], |
73
|
20
|
|
|
20
|
|
5874
|
'CPANPLUS::Module') }; |
|
20
|
|
|
|
|
53
|
|
|
20
|
|
|
|
|
1239
|
|
74
|
27
|
|
|
|
|
1531
|
use constant IS_FAKE_MODOBJ => sub { UNIVERSAL::isa($_[-1], |
75
|
20
|
|
|
20
|
|
10293
|
'CPANPLUS::Module::Fake') }; |
|
20
|
|
|
|
|
12469
|
|
|
20
|
|
|
|
|
1469
|
|
76
|
8
|
|
|
|
|
100
|
use constant IS_AUTHOBJ => sub { UNIVERSAL::isa($_[-1], |
77
|
20
|
|
|
20
|
|
141
|
'CPANPLUS::Module::Author') }; |
|
20
|
|
|
|
|
171
|
|
|
20
|
|
|
|
|
1386
|
|
78
|
|
|
|
|
|
|
use constant IS_FAKE_AUTHOBJ |
79
|
20
|
|
|
|
|
119
|
=> sub { UNIVERSAL::isa($_[-1], |
80
|
20
|
|
|
20
|
|
129
|
'CPANPLUS::Module::Author::Fake') }; |
|
20
|
|
|
|
|
44
|
|
|
20
|
|
|
|
|
1002
|
|
81
|
|
|
|
|
|
|
|
82
|
29
|
|
|
|
|
1758
|
use constant IS_CONFOBJ => sub { UNIVERSAL::isa($_[-1], |
83
|
20
|
|
|
20
|
|
38
|
'CPANPLUS::Configure') }; |
|
20
|
|
|
|
|
956
|
|
|
20
|
|
|
|
|
125
|
|
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
|
|
29
|
use constant IS_RVOBJ => sub { UNIVERSAL::isa($_[-1], |
86
|
20
|
|
|
20
|
|
44
|
'CPANPLUS::Backend::RV') }; |
|
20
|
|
|
|
|
1115
|
|
|
20
|
|
|
|
|
137
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
use constant IS_INTERNALS_OBJ |
89
|
20
|
|
|
|
|
39
|
=> sub { UNIVERSAL::isa($_[-1], |
90
|
20
|
|
|
20
|
|
38
|
'CPANPLUS::Internals') }; |
|
20
|
|
|
|
|
987
|
|
|
20
|
|
|
|
|
120
|
|
91
|
|
|
|
|
|
|
|
92
|
20
|
100
|
|
20
|
|
980
|
use constant IS_FILE => sub { return 1 if -e $_[-1] }; |
|
20
|
|
|
|
|
166
|
|
|
20
|
|
|
|
|
51
|
|
|
20
|
|
|
|
|
1087
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
use constant FILE_EXISTS => sub { |
95
|
20
|
|
|
|
|
118
|
my $file = $_[-1]; |
96
|
20
|
100
|
|
|
|
47
|
return 1 if IS_FILE->($file); |
97
|
20
|
|
|
|
|
949
|
local $Carp::CarpLevel = |
98
|
|
|
|
|
|
|
$Carp::CarpLevel+2; |
99
|
20
|
|
|
|
|
143
|
error(loc( q[File '%1' does not exist], |
100
|
|
|
|
|
|
|
$file)); |
101
|
20
|
|
|
|
|
47
|
return; |
102
|
20
|
|
|
20
|
|
125
|
}; |
|
20
|
|
|
|
|
45
|
|
|
20
|
|
|
|
|
965
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
use constant FILE_READABLE => sub { |
105
|
20
|
|
|
|
|
1028
|
my $file = $_[-1]; |
106
|
20
|
50
|
33
|
|
|
126
|
return 1 if -e $file && -r _; |
107
|
20
|
|
|
|
|
53
|
local $Carp::CarpLevel = |
108
|
|
|
|
|
|
|
$Carp::CarpLevel+2; |
109
|
20
|
|
|
|
|
1161
|
error( loc( q[File '%1' is not readable ]. |
110
|
|
|
|
|
|
|
q[or does not exist], $file)); |
111
|
20
|
|
|
|
|
127
|
return; |
112
|
20
|
|
|
20
|
|
1064
|
}; |
|
20
|
|
|
|
|
145
|
|
|
20
|
|
|
|
|
47
|
|
113
|
20
|
50
|
|
20
|
|
45
|
use constant IS_DIR => sub { return 1 if -d $_[-1] }; |
|
20
|
|
|
|
|
1016
|
|
|
20
|
|
|
|
|
125
|
|
|
20
|
|
|
|
|
37
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
use constant DIR_EXISTS => sub { |
116
|
20
|
|
|
|
|
1117
|
my $dir = $_[-1]; |
117
|
20
|
100
|
|
|
|
133
|
return 1 if IS_DIR->($dir); |
118
|
20
|
|
|
|
|
38
|
local $Carp::CarpLevel = |
119
|
|
|
|
|
|
|
$Carp::CarpLevel+2; |
120
|
20
|
|
|
|
|
972
|
error(loc(q[Dir '%1' does not exist], |
121
|
|
|
|
|
|
|
$dir)); |
122
|
20
|
|
|
|
|
132
|
return; |
123
|
20
|
|
|
20
|
|
1115
|
}; |
|
20
|
|
|
|
|
162
|
|
|
20
|
|
|
|
|
54
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
### On VMS, if the $Config{make} is either MMK |
126
|
|
|
|
|
|
|
### or MMS, then the makefile is 'DESCRIP.MMS'. |
127
|
|
|
|
|
|
|
use constant MAKEFILE => sub { my $file = |
128
|
|
|
|
|
|
|
(ON_VMS and |
129
|
20
|
|
|
|
|
36
|
$Config::Config{make} =~ /MM[S|K]/i) |
130
|
|
|
|
|
|
|
? 'DESCRIP.MMS' |
131
|
|
|
|
|
|
|
: 'Makefile'; |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
return @_ |
134
|
20
|
100
|
|
|
|
1058
|
? File::Spec->catfile( @_, $file ) |
135
|
|
|
|
|
|
|
: $file; |
136
|
20
|
|
|
20
|
|
41
|
}; |
|
20
|
|
|
|
|
1156
|
|
|
20
|
|
|
|
|
125
|
|
137
|
|
|
|
|
|
|
use constant MAKEFILE_PL => sub { return @_ |
138
|
20
|
100
|
|
|
|
124
|
? File::Spec->catfile( @_, |
139
|
|
|
|
|
|
|
'Makefile.PL' ) |
140
|
|
|
|
|
|
|
: 'Makefile.PL'; |
141
|
20
|
|
|
20
|
|
124
|
}; |
|
20
|
|
|
|
|
37
|
|
|
20
|
|
|
|
|
1062
|
|
142
|
|
|
|
|
|
|
use constant BUILD_PL => sub { return @_ |
143
|
20
|
100
|
|
|
|
36
|
? File::Spec->catfile( @_, |
144
|
|
|
|
|
|
|
'Build.PL' ) |
145
|
|
|
|
|
|
|
: 'Build.PL'; |
146
|
20
|
|
|
20
|
|
49
|
}; |
|
20
|
|
|
|
|
1157
|
|
|
20
|
|
|
|
|
130
|
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
use constant META_YML => sub { return @_ |
149
|
20
|
100
|
|
|
|
1092
|
? File::Spec->catfile( @_, 'META.yml' ) |
150
|
|
|
|
|
|
|
: 'META.yml'; |
151
|
20
|
|
|
20
|
|
1075
|
}; |
|
20
|
|
|
|
|
120
|
|
|
20
|
|
|
|
|
37
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
use constant MYMETA_YML => sub { return @_ |
154
|
20
|
50
|
|
|
|
128
|
? File::Spec->catfile( @_, 'MYMETA.yml' ) |
155
|
|
|
|
|
|
|
: 'MYMETA.yml'; |
156
|
20
|
|
|
20
|
|
129
|
}; |
|
20
|
|
|
|
|
66
|
|
|
20
|
|
|
|
|
1044
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
use constant META_JSON => sub { return @_ |
159
|
20
|
50
|
|
|
|
41
|
? File::Spec->catfile( @_, 'META.json' ) |
160
|
|
|
|
|
|
|
: 'META.json'; |
161
|
20
|
|
|
20
|
|
36
|
}; |
|
20
|
|
|
|
|
1038
|
|
|
20
|
|
|
|
|
122
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
use constant MYMETA_JSON => sub { return @_ |
164
|
20
|
50
|
|
|
|
959
|
? File::Spec->catfile( @_, 'MYMETA.json' ) |
165
|
|
|
|
|
|
|
: 'MYMETA.json'; |
166
|
20
|
|
|
20
|
|
972
|
}; |
|
20
|
|
|
|
|
120
|
|
|
20
|
|
|
|
|
42
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
use constant BLIB => sub { return @_ |
169
|
20
|
50
|
|
|
|
161
|
? File::Spec->catfile(@_, 'blib') |
170
|
|
|
|
|
|
|
: 'blib'; |
171
|
20
|
|
|
20
|
|
118
|
}; |
|
20
|
|
|
|
|
37
|
|
|
20
|
|
|
|
|
1977
|
|
172
|
|
|
|
|
|
|
|
173
|
20
|
|
|
20
|
|
38
|
use constant LIB => 'lib'; |
|
20
|
|
|
|
|
1564
|
|
|
11
|
|
|
|
|
221
|
|
174
|
|
|
|
|
|
|
use constant LIB_DIR => sub { return @_ |
175
|
20
|
100
|
|
|
|
1681
|
? File::Spec->catdir(@_, LIB) |
176
|
|
|
|
|
|
|
: LIB; |
177
|
0
|
|
|
20
|
|
0
|
}; |
|
20
|
|
|
|
|
137
|
|
|
20
|
|
|
|
|
39
|
|
178
|
2
|
|
|
20
|
|
249
|
use constant AUTO => 'auto'; |
|
20
|
|
|
|
|
140
|
|
|
20
|
|
|
|
|
70
|
|
179
|
|
|
|
|
|
|
use constant LIB_AUTO_DIR => sub { return @_ |
180
|
20
|
50
|
|
|
|
2004
|
? File::Spec->catdir(@_, LIB, AUTO) |
181
|
|
|
|
|
|
|
: File::Spec->catdir(LIB, AUTO) |
182
|
20
|
|
|
20
|
|
1821
|
}; |
|
183
|
|
|
|
|
23336
|
|
|
20
|
|
|
|
|
67
|
|
183
|
20
|
|
|
20
|
|
155
|
use constant ARCH => 'arch'; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
1638
|
|
184
|
|
|
|
|
|
|
use constant ARCH_DIR => sub { return @_ |
185
|
0
|
0
|
|
|
|
0
|
? File::Spec->catdir(@_, ARCH) |
186
|
|
|
|
|
|
|
: ARCH; |
187
|
363
|
|
|
20
|
|
82332
|
}; |
|
20
|
|
|
|
|
47
|
|
|
20
|
|
|
|
|
1587
|
|
188
|
|
|
|
|
|
|
use constant ARCH_AUTO_DIR => sub { return @_ |
189
|
44
|
0
|
|
|
|
2643
|
? File::Spec->catdir(@_,ARCH,AUTO) |
190
|
|
|
|
|
|
|
: File::Spec->catdir(ARCH,AUTO) |
191
|
20
|
|
|
20
|
|
138
|
}; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
1661
|
|
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
use constant BLIB_LIBDIR => sub { return @_ |
194
|
20
|
0
|
|
|
|
53
|
? File::Spec->catdir( |
195
|
|
|
|
|
|
|
@_, BLIB->(), LIB ) |
196
|
|
|
|
|
|
|
: File::Spec->catdir( BLIB->(), LIB ); |
197
|
20
|
|
|
20
|
|
52
|
}; |
|
20
|
|
|
|
|
1959
|
|
|
20
|
|
|
|
|
154
|
|
198
|
|
|
|
|
|
|
|
199
|
20
|
|
|
20
|
|
1536
|
use constant BIN => 'bin'; |
|
15
|
|
|
|
|
330
|
|
|
20
|
|
|
|
|
153
|
|
200
|
|
|
|
|
|
|
|
201
|
20
|
|
|
20
|
|
39
|
use constant SCRIPT => 'script'; |
|
20
|
|
|
|
|
2425
|
|
|
290
|
|
|
|
|
19216
|
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
use constant CONFIG_USER_LIB_DIR => sub { |
204
|
98
|
|
|
|
|
9869
|
require CPANPLUS::Internals::Utils; |
205
|
98
|
|
|
|
|
480
|
LIB_DIR->( |
206
|
|
|
|
|
|
|
CPANPLUS::Internals::Utils->_home_dir, |
207
|
|
|
|
|
|
|
DOT_CPANPLUS |
208
|
|
|
|
|
|
|
); |
209
|
20
|
|
|
20
|
|
136
|
}; |
|
20
|
|
|
|
|
45
|
|
|
20
|
|
|
|
|
2350
|
|
210
|
|
|
|
|
|
|
use constant CONFIG_USER_FILE => sub { |
211
|
20
|
|
|
|
|
158
|
File::Spec->catfile( |
212
|
|
|
|
|
|
|
CONFIG_USER_LIB_DIR->(), |
213
|
|
|
|
|
|
|
split('::', CONFIG_USER), |
214
|
|
|
|
|
|
|
) . '.pm'; |
215
|
0
|
|
|
20
|
|
0
|
}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
216
|
|
|
|
|
|
|
use constant CONFIG_SYSTEM_FILE => sub { |
217
|
22
|
|
|
|
|
926
|
require CPANPLUS::Internals; |
218
|
0
|
|
|
|
|
0
|
require File::Basename; |
219
|
|
|
|
|
|
|
my $dir = File::Basename::dirname( |
220
|
0
|
|
|
|
|
0
|
$INC{'CPANPLUS/Internals.pm'} |
221
|
|
|
|
|
|
|
); |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
### XXX use constants |
224
|
0
|
|
|
|
|
0
|
File::Spec->catfile( |
225
|
|
|
|
|
|
|
$dir, qw[Config System.pm] |
226
|
|
|
|
|
|
|
); |
227
|
20
|
|
|
20
|
|
37
|
}; |
|
20
|
|
|
|
|
1594
|
|
|
22
|
|
|
|
|
1871
|
|
228
|
|
|
|
|
|
|
|
229
|
88
|
|
|
|
|
2719
|
use constant README => sub { my $obj = $_[0]; |
230
|
20
|
|
|
|
|
146
|
my $pkg = $obj->package_name; |
231
|
20
|
|
|
|
|
47
|
$pkg .= '-' . $obj->package_version . |
232
|
|
|
|
|
|
|
'.readme'; |
233
|
20
|
|
|
|
|
3122
|
return $pkg; |
234
|
20
|
|
|
20
|
|
166
|
}; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
2179
|
|
235
|
71
|
|
|
20
|
|
7790
|
use constant META_EXT => 'meta'; |
|
71
|
|
|
|
|
677
|
|
|
1
|
|
|
|
|
30
|
|
236
|
|
|
|
|
|
|
|
237
|
20
|
|
|
|
|
47
|
use constant META => sub { my $obj = $_[0]; |
238
|
20
|
|
|
|
|
1713
|
my $pkg = $obj->package_name; |
239
|
6
|
|
|
|
|
1790
|
$pkg .= '-' . $obj->package_version . |
240
|
|
|
|
|
|
|
'.' . META_EXT; |
241
|
6
|
|
|
|
|
398
|
return $pkg; |
242
|
1
|
|
|
20
|
|
35
|
}; |
|
1
|
|
|
|
|
36
|
|
|
20
|
|
|
|
|
149
|
|
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
use constant OPEN_FILE => sub { |
245
|
21
|
|
|
|
|
2240
|
my($file, $mode) = (@_, ''); |
246
|
20
|
|
|
|
|
520
|
my $fh; |
247
|
20
|
0
|
|
|
|
303
|
open $fh, "$mode" . $file |
248
|
|
|
|
|
|
|
or error(loc( |
249
|
|
|
|
|
|
|
"Could not open file '%1': %2", |
250
|
|
|
|
|
|
|
$file, $!)); |
251
|
20
|
50
|
|
|
|
1695
|
return $fh if $fh; |
252
|
21
|
|
|
|
|
2295
|
return; |
253
|
20
|
|
|
20
|
|
133
|
}; |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
1644
|
|
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
use constant OPEN_DIR => sub { |
256
|
27
|
|
|
|
|
3032
|
my $dir = shift; |
257
|
20
|
|
|
|
|
146
|
my $dh; |
258
|
20
|
50
|
|
|
|
39
|
opendir $dh, $dir or error(loc( |
259
|
|
|
|
|
|
|
"Could not open dir '%1': %2", $dir, $! |
260
|
|
|
|
|
|
|
)); |
261
|
|
|
|
|
|
|
|
262
|
20
|
50
|
|
|
|
1726
|
return $dh if $dh; |
263
|
3
|
|
|
|
|
357
|
return; |
264
|
20
|
|
|
20
|
|
130
|
}; |
|
20
|
|
|
|
|
52
|
|
|
20
|
|
|
|
|
1678
|
|
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
use constant READ_DIR => sub { |
267
|
21
|
|
|
|
|
2380
|
my $dir = shift; |
268
|
20
|
50
|
|
|
|
130
|
my $dh = OPEN_DIR->( $dir ) or return; |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
### exclude . and .. |
271
|
20
|
|
|
|
|
37
|
my @files = grep { $_ !~ /^\.{1,2}/ } |
|
20
|
|
|
|
|
1564
|
|
272
|
|
|
|
|
|
|
readdir($dh); |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
### Remove trailing dot on VMS when |
275
|
|
|
|
|
|
|
### using VMS syntax. |
276
|
3
|
|
|
|
|
384
|
if( ON_VMS ) { |
277
|
|
|
|
|
|
|
s/(?<!\^)\.$// for @files; |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
20
|
|
|
|
|
135
|
return @files; |
281
|
20
|
|
|
20
|
|
136
|
}; |
|
20
|
|
|
|
|
40
|
|
|
20
|
|
|
|
|
1594
|
|
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
use constant STRIP_GZ_SUFFIX |
284
|
|
|
|
|
|
|
=> sub { |
285
|
20
|
50
|
|
|
|
133
|
my $file = $_[0] or return; |
286
|
20
|
|
|
|
|
42
|
$file =~ s/.gz$//i; |
287
|
20
|
|
|
|
|
1545
|
return $file; |
288
|
20
|
|
|
20
|
|
53
|
}; |
|
20
|
|
|
|
|
1100
|
|
|
59
|
|
|
|
|
1893
|
|
289
|
|
|
|
|
|
|
|
290
|
20
|
|
|
20
|
|
176
|
use constant CHECKSUMS => 'CHECKSUMS'; |
|
20
|
|
|
|
|
62
|
|
|
20
|
|
|
|
|
1309
|
|
291
|
7
|
|
|
20
|
|
152
|
use constant PGP_HEADER => '-----BEGIN PGP SIGNED MESSAGE-----'; |
|
20
|
|
|
|
|
143
|
|
|
20
|
|
|
|
|
57
|
|
292
|
20
|
|
|
|
|
41
|
use constant ENV_CPANPLUS_CONFIG |
293
|
20
|
|
|
20
|
|
2036
|
=> 'PERL5_CPANPLUS_CONFIG'; |
|
20
|
|
|
|
|
143
|
|
294
|
20
|
|
|
|
|
160
|
use constant ENV_CPANPLUS_IS_EXECUTING |
295
|
20
|
|
|
20
|
|
1375
|
=> 'PERL5_CPANPLUS_IS_EXECUTING'; |
|
0
|
|
|
|
|
0
|
|
296
|
20
|
|
|
20
|
|
38
|
use constant DEFAULT_EMAIL => 'cpanplus@example.com'; |
|
20
|
|
|
|
|
1472
|
|
|
20
|
|
|
|
|
126
|
|
297
|
|
|
|
|
|
|
use constant CPANPLUS_UA => sub { ### for the version number ### |
298
|
20
|
|
|
|
|
139
|
require CPANPLUS::Internals; |
299
|
20
|
|
|
|
|
41
|
"CPANPLUS/$CPANPLUS::Internals::VERSION" |
300
|
20
|
|
|
20
|
|
37
|
}; |
|
20
|
|
|
|
|
2430
|
|
|
0
|
|
|
|
|
0
|
|
301
|
|
|
|
|
|
|
use constant TESTERS_URL => sub { |
302
|
20
|
|
|
|
|
38
|
'http://cpantesters.org/distro/'. |
303
|
|
|
|
|
|
|
uc(substr($_[0],0,1)) .'/'. $_[0] . '.yaml'; |
304
|
20
|
|
|
20
|
|
1909
|
}; |
|
0
|
|
|
|
|
0
|
|
|
20
|
|
|
|
|
144
|
|
305
|
|
|
|
|
|
|
use constant TESTERS_DETAILS_URL |
306
|
|
|
|
|
|
|
=> sub { |
307
|
20
|
|
|
|
|
49
|
'http://cpantesters.org/distro/'. |
308
|
|
|
|
|
|
|
uc(substr($_[0],0,1)) .'/'. $_[0]; |
309
|
20
|
|
|
20
|
|
1092
|
}; |
|
0
|
|
|
|
|
0
|
|
|
20
|
|
|
|
|
126
|
|
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
use constant CREATE_FILE_URI |
312
|
|
|
|
|
|
|
=> sub { |
313
|
20
|
50
|
|
|
|
1681
|
my $dir = $_[0] or return; |
314
|
20
|
50
|
|
|
|
157
|
return $dir =~ m|^/| |
315
|
|
|
|
|
|
|
? 'file://' . $dir |
316
|
|
|
|
|
|
|
: 'file:///' . $dir; |
317
|
20
|
|
|
20
|
|
969
|
}; |
|
20
|
|
|
|
|
121
|
|
|
20
|
|
|
|
|
38
|
|
318
|
|
|
|
|
|
|
|
319
|
20
|
|
|
20
|
|
35
|
use constant EMPTY_DSLIP => ' '; |
|
20
|
|
|
|
|
2100
|
|
|
0
|
|
|
|
|
0
|
|
320
|
|
|
|
|
|
|
|
321
|
20
|
|
|
|
|
45
|
use constant CUSTOM_AUTHOR_ID |
322
|
0
|
|
|
20
|
|
0
|
=> 'LOCAL'; |
|
20
|
|
|
|
|
134
|
|
323
|
|
|
|
|
|
|
|
324
|
20
|
|
|
|
|
134
|
use constant DOT_SHELL_DEFAULT_RC |
325
|
20
|
|
|
20
|
|
2405
|
=> '.shell-default.rc'; |
|
0
|
|
|
|
|
0
|
|
326
|
|
|
|
|
|
|
|
327
|
0
|
|
|
|
|
0
|
use constant SOURCE_SQLITE_DB |
328
|
20
|
|
|
20
|
|
35
|
=> 'db.sql'; |
|
20
|
|
|
|
|
2029
|
|
329
|
|
|
|
|
|
|
|
330
|
0
|
|
|
20
|
|
0
|
use constant PREREQ_IGNORE => 0; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
331
|
20
|
|
|
20
|
|
149
|
use constant PREREQ_INSTALL => 1; |
|
20
|
|
|
|
|
69
|
|
|
20
|
|
|
|
|
1302
|
|
332
|
2
|
|
|
20
|
|
11
|
use constant PREREQ_ASK => 2; |
|
2
|
|
|
|
|
24
|
|
|
2
|
|
|
|
|
24
|
|
333
|
2
|
|
|
20
|
|
8
|
use constant PREREQ_BUILD => 3; |
|
20
|
|
|
|
|
132
|
|
|
20
|
|
|
|
|
42
|
|
334
|
20
|
|
|
20
|
|
2003
|
use constant BOOLEANS => [0,1]; |
|
20
|
|
|
|
|
133
|
|
|
20
|
|
|
|
|
47
|
|
335
|
|
|
|
|
|
|
use constant CALLING_FUNCTION |
336
|
0
|
|
50
|
|
|
0
|
=> sub { my $lvl = $_[0] || 0; |
337
|
0
|
|
|
|
|
0
|
return join '::', (caller(2+$lvl))[3] |
338
|
20
|
|
|
20
|
|
2706
|
}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
339
|
20
|
|
|
20
|
|
136
|
use constant PERL_CORE => 'perl'; |
|
20
|
|
|
|
|
46
|
|
|
20
|
|
|
|
|
2285
|
|
340
|
86
|
|
|
20
|
|
882
|
use constant PERL_WRAPPER => 'use strict; BEGIN { my $old = select STDERR; $|++; select $old; $|++; $0 = shift(@ARGV); my $rv = do($0); die $@ if $@; }'; |
|
86
|
|
|
|
|
406
|
|
|
86
|
|
|
|
|
7124
|
|
341
|
86
|
|
|
20
|
|
1180
|
use constant STORABLE_EXT => '.stored'; |
|
0
|
|
|
|
|
0
|
|
|
20
|
|
|
|
|
142
|
|
342
|
|
|
|
|
|
|
|
343
|
7
|
50
|
|
|
|
18
|
use constant GET_XS_FILES => sub { my $dir = $_[0] or return; |
344
|
7
|
|
|
|
|
374
|
require File::Find; |
345
|
7
|
|
|
|
|
58
|
my @files; |
346
|
|
|
|
|
|
|
File::Find::find( |
347
|
20
|
0
|
|
|
|
152
|
sub { push @files, $File::Find::name |
348
|
|
|
|
|
|
|
if $File::Find::name =~ /\.xs$/i |
349
|
0
|
|
|
|
|
0
|
}, $dir ); |
350
|
|
|
|
|
|
|
|
351
|
20
|
|
|
|
|
54
|
return @files; |
352
|
20
|
|
|
20
|
|
62
|
}; |
|
20
|
|
|
|
|
3891
|
|
|
7
|
|
|
|
|
17
|
|
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
use constant INSTALL_LOG_FILE |
355
|
7
|
0
|
|
|
|
242
|
=> sub { my $obj = shift or return; |
356
|
21
|
|
|
|
|
128
|
my $name = $obj->name; $name =~ s/::/-/g; |
|
7
|
|
|
|
|
17
|
|
357
|
7
|
|
|
|
|
134
|
$name .= '-'. $obj->version; |
358
|
20
|
|
|
|
|
138
|
$name .= '-'. scalar(time) . '.log'; |
359
|
20
|
|
|
|
|
40
|
return $name; |
360
|
20
|
|
|
20
|
|
2284
|
}; |
|
7
|
|
|
|
|
24
|
|
|
7
|
|
|
|
|
26
|
|
361
|
|
|
|
|
|
|
|
362
|
62
|
|
|
|
|
739
|
use constant ON_OLD_CYGWIN => do { ON_CYGWIN and $] < 5.008 |
|
62
|
|
|
|
|
327
|
|
363
|
|
|
|
|
|
|
? loc( |
364
|
|
|
|
|
|
|
"Your perl version for %1 is too low; ". |
365
|
|
|
|
|
|
|
"Require %2 or higher for this function", |
366
|
|
|
|
|
|
|
$^O, '5.8.0' ) |
367
|
|
|
|
|
|
|
: ''; |
368
|
20
|
|
|
20
|
|
1074
|
}; |
|
62
|
|
|
|
|
541
|
|
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
### XXX these 2 are probably obsolete -- check & remove; |
371
|
20
|
|
|
20
|
|
122
|
use constant DOT_EXISTS => '.exists'; |
|
20
|
|
|
|
|
43
|
|
|
20
|
|
|
|
|
1078
|
|
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
use constant QUOTE_PERL_ONE_LINER |
374
|
20
|
0
|
|
|
|
152
|
=> sub { my $line = shift or return; |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
### use double quotes on these systems |
377
|
20
|
|
|
|
|
59
|
return qq["$line"] |
378
|
|
|
|
|
|
|
if ON_WIN32 || ON_NETWARE || ON_VMS; |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
### single quotes on the rest |
381
|
20
|
|
|
|
|
1117
|
return qq['$line']; |
382
|
20
|
|
|
20
|
|
117
|
}; |
|
20
|
|
|
|
|
46
|
|
|
20
|
|
|
|
|
1067
|
|
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
1; |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
# Local variables: |
387
|
|
|
|
|
|
|
# c-indentation-style: bsd |
388
|
|
|
|
|
|
|
# c-basic-offset: 4 |
389
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
390
|
|
|
|
|
|
|
# End: |
391
|
|
|
|
|
|
|
# vim: expandtab shiftwidth=4: |