line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS::Internals::Constants; |
2
|
|
|
|
|
|
|
|
3
|
0
|
|
|
20
|
|
0
|
use strict; |
|
1
|
|
|
|
|
441
|
|
|
0
|
|
|
|
|
0
|
|
4
|
|
|
|
|
|
|
|
5
|
123
|
|
|
20
|
|
24044
|
use CPANPLUS::Error; |
|
0
|
|
|
|
|
0
|
|
|
3
|
|
|
|
|
201
|
|
6
|
|
|
|
|
|
|
|
7
|
0
|
|
|
20
|
|
0
|
use Config; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
20
|
|
27
|
use File::Spec; |
|
3
|
|
|
|
|
201
|
|
|
0
|
|
|
|
|
0
|
|
9
|
0
|
|
|
20
|
|
0
|
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; |
|
0
|
|
|
|
|
0
|
|
|
8
|
|
|
|
|
81
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require Exporter; |
12
|
8
|
|
|
20
|
|
58
|
use vars qw[$VERSION @ISA @EXPORT]; |
|
7
|
|
|
|
|
623
|
|
|
7
|
|
|
|
|
119
|
|
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
20
|
|
0
|
use Package::Constants; |
|
0
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
24
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$VERSION = "0.9914"; |
17
|
|
|
|
|
|
|
@ISA = qw[Exporter]; |
18
|
|
|
|
|
|
|
@EXPORT = Package::Constants->list( __PACKAGE__ ); |
19
|
|
|
|
|
|
|
|
20
|
20
|
|
|
0
|
0
|
138
|
sub constants { @EXPORT }; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
0
|
use constant INSTALLER_BUILD |
23
|
1
|
|
|
20
|
|
24
|
=> 'CPANPLUS::Dist::Build'; |
|
1
|
|
|
|
|
81
|
|
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
|
|
|
|
|
52
|
|
|
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
|
|
47
|
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
|
|
139
|
use constant NMAKE => 'nmake.exe'; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
741
|
|
62
|
20
|
|
|
|
|
1367
|
use constant NMAKE_URL => |
63
|
20
|
|
|
20
|
|
6912
|
'ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe'; |
|
20
|
|
|
|
|
59
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
use constant INSTALL_VIA_PACKAGE_MANAGER |
66
|
20
|
100
|
|
|
|
114
|
=> sub { my $fmt = $_[0] or return; |
67
|
20
|
100
|
33
|
|
|
36
|
return 1 if $fmt ne INSTALLER_BUILD and |
68
|
|
|
|
|
|
|
$fmt ne INSTALLER_MM; |
69
|
20
|
|
|
20
|
|
150
|
}; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
742
|
|
70
|
|
|
|
|
|
|
|
71
|
20
|
|
|
20
|
|
514
|
use constant IS_CODEREF => sub { ref $_[-1] eq 'CODE' }; |
|
20
|
|
|
|
|
99
|
|
|
20
|
|
|
|
|
52
|
|
|
20
|
|
|
|
|
104
|
|
72
|
287
|
|
|
|
|
50229
|
use constant IS_MODOBJ => sub { UNIVERSAL::isa($_[-1], |
73
|
20
|
|
|
20
|
|
5488
|
'CPANPLUS::Module') }; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
1324
|
|
74
|
27
|
|
|
|
|
1045
|
use constant IS_FAKE_MODOBJ => sub { UNIVERSAL::isa($_[-1], |
75
|
20
|
|
|
20
|
|
10480
|
'CPANPLUS::Module::Fake') }; |
|
20
|
|
|
|
|
11986
|
|
|
20
|
|
|
|
|
1497
|
|
76
|
8
|
|
|
|
|
128
|
use constant IS_AUTHOBJ => sub { UNIVERSAL::isa($_[-1], |
77
|
20
|
|
|
20
|
|
143
|
'CPANPLUS::Module::Author') }; |
|
20
|
|
|
|
|
165
|
|
|
20
|
|
|
|
|
1636
|
|
78
|
|
|
|
|
|
|
use constant IS_FAKE_AUTHOBJ |
79
|
20
|
|
|
|
|
115
|
=> sub { UNIVERSAL::isa($_[-1], |
80
|
20
|
|
|
20
|
|
132
|
'CPANPLUS::Module::Author::Fake') }; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
1003
|
|
81
|
|
|
|
|
|
|
|
82
|
29
|
|
|
|
|
1830
|
use constant IS_CONFOBJ => sub { UNIVERSAL::isa($_[-1], |
83
|
20
|
|
|
20
|
|
37
|
'CPANPLUS::Configure') }; |
|
20
|
|
|
|
|
950
|
|
|
20
|
|
|
|
|
131
|
|
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
|
|
36
|
use constant IS_RVOBJ => sub { UNIVERSAL::isa($_[-1], |
86
|
20
|
|
|
20
|
|
44
|
'CPANPLUS::Backend::RV') }; |
|
20
|
|
|
|
|
1150
|
|
|
20
|
|
|
|
|
117
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
use constant IS_INTERNALS_OBJ |
89
|
20
|
|
|
|
|
50
|
=> sub { UNIVERSAL::isa($_[-1], |
90
|
20
|
|
|
20
|
|
38
|
'CPANPLUS::Internals') }; |
|
20
|
|
|
|
|
1051
|
|
|
20
|
|
|
|
|
123
|
|
91
|
|
|
|
|
|
|
|
92
|
20
|
100
|
|
20
|
|
1016
|
use constant IS_FILE => sub { return 1 if -e $_[-1] }; |
|
20
|
|
|
|
|
119
|
|
|
20
|
|
|
|
|
43
|
|
|
20
|
|
|
|
|
1089
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
use constant FILE_EXISTS => sub { |
95
|
20
|
|
|
|
|
130
|
my $file = $_[-1]; |
96
|
20
|
100
|
|
|
|
37
|
return 1 if IS_FILE->($file); |
97
|
20
|
|
|
|
|
1025
|
local $Carp::CarpLevel = |
98
|
|
|
|
|
|
|
$Carp::CarpLevel+2; |
99
|
20
|
|
|
|
|
152
|
error(loc( q[File '%1' does not exist], |
100
|
|
|
|
|
|
|
$file)); |
101
|
20
|
|
|
|
|
63
|
return; |
102
|
20
|
|
|
20
|
|
128
|
}; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
1002
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
use constant FILE_READABLE => sub { |
105
|
20
|
|
|
|
|
1069
|
my $file = $_[-1]; |
106
|
20
|
50
|
33
|
|
|
131
|
return 1 if -e $file && -r _; |
107
|
20
|
|
|
|
|
50
|
local $Carp::CarpLevel = |
108
|
|
|
|
|
|
|
$Carp::CarpLevel+2; |
109
|
20
|
|
|
|
|
1314
|
error( loc( q[File '%1' is not readable ]. |
110
|
|
|
|
|
|
|
q[or does not exist], $file)); |
111
|
20
|
|
|
|
|
149
|
return; |
112
|
20
|
|
|
20
|
|
1231
|
}; |
|
20
|
|
|
|
|
143
|
|
|
20
|
|
|
|
|
37
|
|
113
|
20
|
50
|
|
20
|
|
65
|
use constant IS_DIR => sub { return 1 if -d $_[-1] }; |
|
20
|
|
|
|
|
1138
|
|
|
20
|
|
|
|
|
133
|
|
|
20
|
|
|
|
|
52
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
use constant DIR_EXISTS => sub { |
116
|
20
|
|
|
|
|
968
|
my $dir = $_[-1]; |
117
|
20
|
100
|
|
|
|
122
|
return 1 if IS_DIR->($dir); |
118
|
20
|
|
|
|
|
70
|
local $Carp::CarpLevel = |
119
|
|
|
|
|
|
|
$Carp::CarpLevel+2; |
120
|
20
|
|
|
|
|
1029
|
error(loc(q[Dir '%1' does not exist], |
121
|
|
|
|
|
|
|
$dir)); |
122
|
20
|
|
|
|
|
124
|
return; |
123
|
20
|
|
|
20
|
|
1040
|
}; |
|
20
|
|
|
|
|
127
|
|
|
20
|
|
|
|
|
38
|
|
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
|
|
|
|
|
64
|
$Config::Config{make} =~ /MM[S|K]/i) |
130
|
|
|
|
|
|
|
? 'DESCRIP.MMS' |
131
|
|
|
|
|
|
|
: 'Makefile'; |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
return @_ |
134
|
20
|
100
|
|
|
|
1232
|
? File::Spec->catfile( @_, $file ) |
135
|
|
|
|
|
|
|
: $file; |
136
|
20
|
|
|
20
|
|
61
|
}; |
|
20
|
|
|
|
|
1241
|
|
|
20
|
|
|
|
|
155
|
|
137
|
|
|
|
|
|
|
use constant MAKEFILE_PL => sub { return @_ |
138
|
20
|
100
|
|
|
|
131
|
? File::Spec->catfile( @_, |
139
|
|
|
|
|
|
|
'Makefile.PL' ) |
140
|
|
|
|
|
|
|
: 'Makefile.PL'; |
141
|
20
|
|
|
20
|
|
129
|
}; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
1212
|
|
142
|
|
|
|
|
|
|
use constant BUILD_PL => sub { return @_ |
143
|
20
|
100
|
|
|
|
37
|
? File::Spec->catfile( @_, |
144
|
|
|
|
|
|
|
'Build.PL' ) |
145
|
|
|
|
|
|
|
: 'Build.PL'; |
146
|
20
|
|
|
20
|
|
60
|
}; |
|
20
|
|
|
|
|
1343
|
|
|
20
|
|
|
|
|
145
|
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
use constant META_YML => sub { return @_ |
149
|
20
|
100
|
|
|
|
1120
|
? File::Spec->catfile( @_, 'META.yml' ) |
150
|
|
|
|
|
|
|
: 'META.yml'; |
151
|
20
|
|
|
20
|
|
1132
|
}; |
|
20
|
|
|
|
|
125
|
|
|
20
|
|
|
|
|
47
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
use constant MYMETA_YML => sub { return @_ |
154
|
20
|
50
|
|
|
|
128
|
? File::Spec->catfile( @_, 'MYMETA.yml' ) |
155
|
|
|
|
|
|
|
: 'MYMETA.yml'; |
156
|
20
|
|
|
20
|
|
125
|
}; |
|
20
|
|
|
|
|
40
|
|
|
20
|
|
|
|
|
1025
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
use constant META_JSON => sub { return @_ |
159
|
20
|
50
|
|
|
|
37
|
? File::Spec->catfile( @_, 'META.json' ) |
160
|
|
|
|
|
|
|
: 'META.json'; |
161
|
20
|
|
|
20
|
|
47
|
}; |
|
20
|
|
|
|
|
1250
|
|
|
20
|
|
|
|
|
128
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
use constant MYMETA_JSON => sub { return @_ |
164
|
20
|
50
|
|
|
|
1172
|
? File::Spec->catfile( @_, 'MYMETA.json' ) |
165
|
|
|
|
|
|
|
: 'MYMETA.json'; |
166
|
20
|
|
|
20
|
|
1015
|
}; |
|
20
|
|
|
|
|
136
|
|
|
20
|
|
|
|
|
111
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
use constant BLIB => sub { return @_ |
169
|
20
|
50
|
|
|
|
163
|
? File::Spec->catfile(@_, 'blib') |
170
|
|
|
|
|
|
|
: 'blib'; |
171
|
20
|
|
|
20
|
|
130
|
}; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
2245
|
|
172
|
|
|
|
|
|
|
|
173
|
20
|
|
|
20
|
|
40
|
use constant LIB => 'lib'; |
|
20
|
|
|
|
|
1692
|
|
|
11
|
|
|
|
|
328
|
|
174
|
|
|
|
|
|
|
use constant LIB_DIR => sub { return @_ |
175
|
20
|
100
|
|
|
|
1667
|
? File::Spec->catdir(@_, LIB) |
176
|
|
|
|
|
|
|
: LIB; |
177
|
0
|
|
|
20
|
|
0
|
}; |
|
20
|
|
|
|
|
141
|
|
|
20
|
|
|
|
|
41
|
|
178
|
2
|
|
|
20
|
|
314
|
use constant AUTO => 'auto'; |
|
20
|
|
|
|
|
135
|
|
|
20
|
|
|
|
|
57
|
|
179
|
|
|
|
|
|
|
use constant LIB_AUTO_DIR => sub { return @_ |
180
|
20
|
50
|
|
|
|
1694
|
? File::Spec->catdir(@_, LIB, AUTO) |
181
|
|
|
|
|
|
|
: File::Spec->catdir(LIB, AUTO) |
182
|
20
|
|
|
20
|
|
1666
|
}; |
|
183
|
|
|
|
|
23528
|
|
|
20
|
|
|
|
|
41
|
|
183
|
20
|
|
|
20
|
|
139
|
use constant ARCH => 'arch'; |
|
20
|
|
|
|
|
50
|
|
|
20
|
|
|
|
|
1738
|
|
184
|
|
|
|
|
|
|
use constant ARCH_DIR => sub { return @_ |
185
|
0
|
0
|
|
|
|
0
|
? File::Spec->catdir(@_, ARCH) |
186
|
|
|
|
|
|
|
: ARCH; |
187
|
363
|
|
|
20
|
|
86773
|
}; |
|
20
|
|
|
|
|
36
|
|
|
20
|
|
|
|
|
1779
|
|
188
|
|
|
|
|
|
|
use constant ARCH_AUTO_DIR => sub { return @_ |
189
|
44
|
0
|
|
|
|
2641
|
? File::Spec->catdir(@_,ARCH,AUTO) |
190
|
|
|
|
|
|
|
: File::Spec->catdir(ARCH,AUTO) |
191
|
20
|
|
|
20
|
|
138
|
}; |
|
20
|
|
|
|
|
45
|
|
|
20
|
|
|
|
|
1790
|
|
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
use constant BLIB_LIBDIR => sub { return @_ |
194
|
20
|
0
|
|
|
|
56
|
? File::Spec->catdir( |
195
|
|
|
|
|
|
|
@_, BLIB->(), LIB ) |
196
|
|
|
|
|
|
|
: File::Spec->catdir( BLIB->(), LIB ); |
197
|
20
|
|
|
20
|
|
39
|
}; |
|
20
|
|
|
|
|
1828
|
|
|
20
|
|
|
|
|
219
|
|
198
|
|
|
|
|
|
|
|
199
|
20
|
|
|
20
|
|
1704
|
use constant BIN => 'bin'; |
|
15
|
|
|
|
|
334
|
|
|
20
|
|
|
|
|
136
|
|
200
|
|
|
|
|
|
|
|
201
|
20
|
|
|
20
|
|
35
|
use constant SCRIPT => 'script'; |
|
20
|
|
|
|
|
2547
|
|
|
290
|
|
|
|
|
20280
|
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
use constant CONFIG_USER_LIB_DIR => sub { |
204
|
98
|
|
|
|
|
10802
|
require CPANPLUS::Internals::Utils; |
205
|
98
|
|
|
|
|
923
|
LIB_DIR->( |
206
|
|
|
|
|
|
|
CPANPLUS::Internals::Utils->_home_dir, |
207
|
|
|
|
|
|
|
DOT_CPANPLUS |
208
|
|
|
|
|
|
|
); |
209
|
20
|
|
|
20
|
|
174
|
}; |
|
20
|
|
|
|
|
58
|
|
|
20
|
|
|
|
|
2540
|
|
210
|
|
|
|
|
|
|
use constant CONFIG_USER_FILE => sub { |
211
|
20
|
|
|
|
|
151
|
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
|
|
|
|
|
969
|
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
|
|
75
|
}; |
|
20
|
|
|
|
|
1687
|
|
|
22
|
|
|
|
|
1996
|
|
228
|
|
|
|
|
|
|
|
229
|
88
|
|
|
|
|
2905
|
use constant README => sub { my $obj = $_[0]; |
230
|
20
|
|
|
|
|
138
|
my $pkg = $obj->package_name; |
231
|
20
|
|
|
|
|
39
|
$pkg .= '-' . $obj->package_version . |
232
|
|
|
|
|
|
|
'.readme'; |
233
|
20
|
|
|
|
|
3091
|
return $pkg; |
234
|
20
|
|
|
20
|
|
137
|
}; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
2378
|
|
235
|
71
|
|
|
20
|
|
8086
|
use constant META_EXT => 'meta'; |
|
71
|
|
|
|
|
686
|
|
|
1
|
|
|
|
|
26
|
|
236
|
|
|
|
|
|
|
|
237
|
20
|
|
|
|
|
37
|
use constant META => sub { my $obj = $_[0]; |
238
|
20
|
|
|
|
|
1846
|
my $pkg = $obj->package_name; |
239
|
6
|
|
|
|
|
385
|
$pkg .= '-' . $obj->package_version . |
240
|
|
|
|
|
|
|
'.' . META_EXT; |
241
|
6
|
|
|
|
|
429
|
return $pkg; |
242
|
1
|
|
|
20
|
|
31
|
}; |
|
1
|
|
|
|
|
24
|
|
|
20
|
|
|
|
|
151
|
|
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
use constant OPEN_FILE => sub { |
245
|
21
|
|
|
|
|
3031
|
my($file, $mode) = (@_, ''); |
246
|
20
|
|
|
|
|
520
|
my $fh; |
247
|
20
|
0
|
|
|
|
305
|
open $fh, "$mode" . $file |
248
|
|
|
|
|
|
|
or error(loc( |
249
|
|
|
|
|
|
|
"Could not open file '%1': %2", |
250
|
|
|
|
|
|
|
$file, $!)); |
251
|
20
|
50
|
|
|
|
1560
|
return $fh if $fh; |
252
|
21
|
|
|
|
|
2747
|
return; |
253
|
20
|
|
|
20
|
|
188
|
}; |
|
20
|
|
|
|
|
58
|
|
|
20
|
|
|
|
|
1777
|
|
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
use constant OPEN_DIR => sub { |
256
|
27
|
|
|
|
|
3027
|
my $dir = shift; |
257
|
20
|
|
|
|
|
135
|
my $dh; |
258
|
20
|
50
|
|
|
|
40
|
opendir $dh, $dir or error(loc( |
259
|
|
|
|
|
|
|
"Could not open dir '%1': %2", $dir, $! |
260
|
|
|
|
|
|
|
)); |
261
|
|
|
|
|
|
|
|
262
|
20
|
50
|
|
|
|
1678
|
return $dh if $dh; |
263
|
3
|
|
|
|
|
378
|
return; |
264
|
20
|
|
|
20
|
|
131
|
}; |
|
20
|
|
|
|
|
68
|
|
|
20
|
|
|
|
|
1642
|
|
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
use constant READ_DIR => sub { |
267
|
21
|
|
|
|
|
2550
|
my $dir = shift; |
268
|
20
|
50
|
|
|
|
136
|
my $dh = OPEN_DIR->( $dir ) or return; |
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
### exclude . and .. |
271
|
20
|
|
|
|
|
37
|
my @files = grep { $_ !~ /^\.{1,2}/ } |
|
20
|
|
|
|
|
1932
|
|
272
|
|
|
|
|
|
|
readdir($dh); |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
### Remove trailing dot on VMS when |
275
|
|
|
|
|
|
|
### using VMS syntax. |
276
|
3
|
|
|
|
|
422
|
if( ON_VMS ) { |
277
|
|
|
|
|
|
|
s/(?
|
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
20
|
|
|
|
|
149
|
return @files; |
281
|
20
|
|
|
20
|
|
145
|
}; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
1768
|
|
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
use constant STRIP_GZ_SUFFIX |
284
|
|
|
|
|
|
|
=> sub { |
285
|
20
|
50
|
|
|
|
132
|
my $file = $_[0] or return; |
286
|
20
|
|
|
|
|
38
|
$file =~ s/.gz$//i; |
287
|
20
|
|
|
|
|
1689
|
return $file; |
288
|
20
|
|
|
20
|
|
40
|
}; |
|
20
|
|
|
|
|
1200
|
|
|
59
|
|
|
|
|
3719
|
|
289
|
|
|
|
|
|
|
|
290
|
20
|
|
|
20
|
|
134
|
use constant CHECKSUMS => 'CHECKSUMS'; |
|
20
|
|
|
|
|
50
|
|
|
20
|
|
|
|
|
1307
|
|
291
|
7
|
|
|
20
|
|
197
|
use constant PGP_HEADER => '-----BEGIN PGP SIGNED MESSAGE-----'; |
|
20
|
|
|
|
|
143
|
|
|
20
|
|
|
|
|
40
|
|
292
|
20
|
|
|
|
|
65
|
use constant ENV_CPANPLUS_CONFIG |
293
|
20
|
|
|
20
|
|
1862
|
=> 'PERL5_CPANPLUS_CONFIG'; |
|
20
|
|
|
|
|
173
|
|
294
|
20
|
|
|
|
|
154
|
use constant ENV_CPANPLUS_IS_EXECUTING |
295
|
20
|
|
|
20
|
|
1505
|
=> 'PERL5_CPANPLUS_IS_EXECUTING'; |
|
0
|
|
|
|
|
0
|
|
296
|
20
|
|
|
20
|
|
48
|
use constant DEFAULT_EMAIL => 'cpanplus@example.com'; |
|
20
|
|
|
|
|
1628
|
|
|
20
|
|
|
|
|
144
|
|
297
|
|
|
|
|
|
|
use constant CPANPLUS_UA => sub { ### for the version number ### |
298
|
20
|
|
|
|
|
144
|
require CPANPLUS::Internals; |
299
|
20
|
|
|
|
|
44
|
"CPANPLUS/$CPANPLUS::Internals::VERSION" |
300
|
20
|
|
|
20
|
|
73
|
}; |
|
20
|
|
|
|
|
2709
|
|
|
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
|
|
1836
|
}; |
|
0
|
|
|
|
|
0
|
|
|
20
|
|
|
|
|
131
|
|
305
|
|
|
|
|
|
|
use constant TESTERS_DETAILS_URL |
306
|
|
|
|
|
|
|
=> sub { |
307
|
20
|
|
|
|
|
46
|
'http://cpantesters.org/distro/'. |
308
|
|
|
|
|
|
|
uc(substr($_[0],0,1)) .'/'. $_[0]; |
309
|
20
|
|
|
20
|
|
1104
|
}; |
|
0
|
|
|
|
|
0
|
|
|
20
|
|
|
|
|
137
|
|
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
use constant CREATE_FILE_URI |
312
|
|
|
|
|
|
|
=> sub { |
313
|
20
|
50
|
|
|
|
1885
|
my $dir = $_[0] or return; |
314
|
20
|
50
|
|
|
|
171
|
return $dir =~ m|^/| |
315
|
|
|
|
|
|
|
? 'file://' . $dir |
316
|
|
|
|
|
|
|
: 'file:///' . $dir; |
317
|
20
|
|
|
20
|
|
1222
|
}; |
|
20
|
|
|
|
|
139
|
|
|
20
|
|
|
|
|
44
|
|
318
|
|
|
|
|
|
|
|
319
|
20
|
|
|
20
|
|
50
|
use constant EMPTY_DSLIP => ' '; |
|
20
|
|
|
|
|
2084
|
|
|
0
|
|
|
|
|
0
|
|
320
|
|
|
|
|
|
|
|
321
|
20
|
|
|
|
|
40
|
use constant CUSTOM_AUTHOR_ID |
322
|
0
|
|
|
20
|
|
0
|
=> 'LOCAL'; |
|
20
|
|
|
|
|
140
|
|
323
|
|
|
|
|
|
|
|
324
|
20
|
|
|
|
|
179
|
use constant DOT_SHELL_DEFAULT_RC |
325
|
20
|
|
|
20
|
|
2636
|
=> '.shell-default.rc'; |
|
0
|
|
|
|
|
0
|
|
326
|
|
|
|
|
|
|
|
327
|
0
|
|
|
|
|
0
|
use constant SOURCE_SQLITE_DB |
328
|
20
|
|
|
20
|
|
37
|
=> 'db.sql'; |
|
20
|
|
|
|
|
2185
|
|
329
|
|
|
|
|
|
|
|
330
|
0
|
|
|
20
|
|
0
|
use constant PREREQ_IGNORE => 0; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
331
|
20
|
|
|
20
|
|
139
|
use constant PREREQ_INSTALL => 1; |
|
20
|
|
|
|
|
47
|
|
|
20
|
|
|
|
|
1650
|
|
332
|
2
|
|
|
20
|
|
9
|
use constant PREREQ_ASK => 2; |
|
2
|
|
|
|
|
27
|
|
|
2
|
|
|
|
|
16
|
|
333
|
2
|
|
|
20
|
|
8
|
use constant PREREQ_BUILD => 3; |
|
20
|
|
|
|
|
139
|
|
|
20
|
|
|
|
|
39
|
|
334
|
20
|
|
|
20
|
|
2174
|
use constant BOOLEANS => [0,1]; |
|
20
|
|
|
|
|
137
|
|
|
20
|
|
|
|
|
41
|
|
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
|
|
2984
|
}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
339
|
20
|
|
|
20
|
|
142
|
use constant PERL_CORE => 'perl'; |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
2313
|
|
340
|
86
|
|
|
20
|
|
998
|
use constant PERL_WRAPPER => 'use strict; BEGIN { my $old = select STDERR; $|++; select $old; $|++; $0 = shift(@ARGV); my $rv = do($0); die $@ if $@; }'; |
|
86
|
|
|
|
|
399
|
|
|
86
|
|
|
|
|
6773
|
|
341
|
86
|
|
|
20
|
|
1515
|
use constant STORABLE_EXT => '.stored'; |
|
0
|
|
|
|
|
0
|
|
|
20
|
|
|
|
|
140
|
|
342
|
|
|
|
|
|
|
|
343
|
7
|
50
|
|
|
|
14
|
use constant GET_XS_FILES => sub { my $dir = $_[0] or return; |
344
|
7
|
|
|
|
|
352
|
require File::Find; |
345
|
7
|
|
|
|
|
61
|
my @files; |
346
|
|
|
|
|
|
|
File::Find::find( |
347
|
20
|
0
|
|
|
|
151
|
sub { push @files, $File::Find::name |
348
|
|
|
|
|
|
|
if $File::Find::name =~ /\.xs$/i |
349
|
0
|
|
|
|
|
0
|
}, $dir ); |
350
|
|
|
|
|
|
|
|
351
|
20
|
|
|
|
|
62
|
return @files; |
352
|
20
|
|
|
20
|
|
47
|
}; |
|
20
|
|
|
|
|
3905
|
|
|
7
|
|
|
|
|
14
|
|
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
use constant INSTALL_LOG_FILE |
355
|
7
|
0
|
|
|
|
215
|
=> sub { my $obj = shift or return; |
356
|
21
|
|
|
|
|
147
|
my $name = $obj->name; $name =~ s/::/-/g; |
|
7
|
|
|
|
|
19
|
|
357
|
7
|
|
|
|
|
157
|
$name .= '-'. $obj->version; |
358
|
20
|
|
|
|
|
151
|
$name .= '-'. scalar(time) . '.log'; |
359
|
20
|
|
|
|
|
47
|
return $name; |
360
|
20
|
|
|
20
|
|
2378
|
}; |
|
7
|
|
|
|
|
26
|
|
|
7
|
|
|
|
|
23
|
|
361
|
|
|
|
|
|
|
|
362
|
62
|
|
|
|
|
758
|
use constant ON_OLD_CYGWIN => do { ON_CYGWIN and $] < 5.008 |
|
62
|
|
|
|
|
294
|
|
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
|
|
1101
|
}; |
|
62
|
|
|
|
|
333
|
|
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
### XXX these 2 are probably obsolete -- check & remove; |
371
|
20
|
|
|
20
|
|
126
|
use constant DOT_EXISTS => '.exists'; |
|
20
|
|
|
|
|
40
|
|
|
20
|
|
|
|
|
999
|
|
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
use constant QUOTE_PERL_ONE_LINER |
374
|
20
|
0
|
|
|
|
125
|
=> sub { my $line = shift or return; |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
### use double quotes on these systems |
377
|
20
|
|
|
|
|
38
|
return qq["$line"] |
378
|
|
|
|
|
|
|
if ON_WIN32 || ON_NETWARE || ON_VMS; |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
### single quotes on the rest |
381
|
20
|
|
|
|
|
1067
|
return qq['$line']; |
382
|
20
|
|
|
20
|
|
126
|
}; |
|
20
|
|
|
|
|
38
|
|
|
20
|
|
|
|
|
1035
|
|
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: |