| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package CPANPLUS::Internals::Constants; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 0 |  |  | 20 |  | 0 | use strict; | 
|  | 1 |  |  |  |  | 344 |  | 
|  | 0 |  |  |  |  | 0 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 123 |  |  | 20 |  | 24162 | use CPANPLUS::Error; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 3 |  |  |  |  | 244 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 0 |  |  | 20 |  | 0 | use Config; | 
|  | 1 |  |  |  |  | 6 |  | 
|  | 1 |  |  |  |  | 4 |  | 
| 8 | 1 |  |  | 20 |  | 33 | use File::Spec; | 
|  | 3 |  |  |  |  | 208 |  | 
|  | 0 |  |  |  |  | 0 |  | 
| 9 | 0 |  |  | 20 |  | 0 | use Locale::Maketext::Simple    Class => 'CPANPLUS', Style => 'gettext'; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 8 |  |  |  |  | 101 |  | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | require Exporter; | 
| 12 | 8 |  |  | 20 |  | 61 | use vars    qw[$VERSION @ISA @EXPORT]; | 
|  | 7 |  |  |  |  | 629 |  | 
|  | 7 |  |  |  |  | 83 |  | 
| 13 |  |  |  |  |  |  |  | 
| 14 | 0 |  |  | 20 |  | 0 | use Package::Constants; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 1 |  |  |  |  | 31 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | $VERSION = "0.9910"; | 
| 17 |  |  |  |  |  |  | @ISA        = qw[Exporter]; | 
| 18 |  |  |  |  |  |  | @EXPORT     = Package::Constants->list( __PACKAGE__ ); | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 20 |  |  | 0 | 0 | 120 | sub constants { @EXPORT }; | 
| 21 |  |  |  |  |  |  |  | 
| 22 | 0 |  |  |  |  | 0 | use constant INSTALLER_BUILD | 
| 23 | 1 |  |  | 20 |  | 23 | => 'CPANPLUS::Dist::Build'; | 
|  | 1 |  |  |  |  | 71 |  | 
| 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 |  |  |  |  | 42 |  | 
|  | 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 |  | 48 | 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 |  | 135 | use constant NMAKE          => 'nmake.exe'; | 
|  | 20 |  |  |  |  | 41 |  | 
|  | 20 |  |  |  |  | 1046 |  | 
| 62 | 20 |  |  |  |  | 1244 | use constant NMAKE_URL      => | 
| 63 | 20 |  |  | 20 |  | 7027 | 'ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe'; | 
|  | 20 |  |  |  |  | 60 |  | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | use constant INSTALL_VIA_PACKAGE_MANAGER | 
| 66 | 20 | 100 |  |  |  | 108 | => sub { my $fmt = $_[0] or return; | 
| 67 | 20 | 100 | 33 |  |  | 35 | return 1 if $fmt ne INSTALLER_BUILD and | 
| 68 |  |  |  |  |  |  | $fmt ne INSTALLER_MM; | 
| 69 | 20 |  |  | 20 |  | 139 | }; | 
|  | 20 |  |  |  |  | 37 |  | 
|  | 20 |  |  |  |  | 762 |  | 
| 70 |  |  |  |  |  |  |  | 
| 71 | 20 |  |  | 20 |  | 485 | use constant IS_CODEREF     => sub { ref $_[-1] eq 'CODE' }; | 
|  | 20 |  |  |  |  | 96 |  | 
|  | 20 |  |  |  |  | 34 |  | 
|  | 20 |  |  |  |  | 95 |  | 
| 72 | 287 |  |  |  |  | 46996 | use constant IS_MODOBJ      => sub { UNIVERSAL::isa($_[-1], | 
| 73 | 20 |  |  | 20 |  | 5504 | 'CPANPLUS::Module') }; | 
|  | 20 |  |  |  |  | 53 |  | 
|  | 20 |  |  |  |  | 1119 |  | 
| 74 | 27 |  |  |  |  | 1606 | use constant IS_FAKE_MODOBJ => sub { UNIVERSAL::isa($_[-1], | 
| 75 | 20 |  |  | 20 |  | 10823 | 'CPANPLUS::Module::Fake') }; | 
|  | 20 |  |  |  |  | 11237 |  | 
|  | 20 |  |  |  |  | 1409 |  | 
| 76 | 8 |  |  |  |  | 124 | use constant IS_AUTHOBJ     => sub { UNIVERSAL::isa($_[-1], | 
| 77 | 20 |  |  | 20 |  | 144 | 'CPANPLUS::Module::Author') }; | 
|  | 20 |  |  |  |  | 191 |  | 
|  | 20 |  |  |  |  | 1511 |  | 
| 78 |  |  |  |  |  |  | use constant IS_FAKE_AUTHOBJ | 
| 79 | 20 |  |  |  |  | 114 | => sub { UNIVERSAL::isa($_[-1], | 
| 80 | 20 |  |  | 20 |  | 121 | 'CPANPLUS::Module::Author::Fake') }; | 
|  | 20 |  |  |  |  | 74 |  | 
|  | 20 |  |  |  |  | 1010 |  | 
| 81 |  |  |  |  |  |  |  | 
| 82 | 29 |  |  |  |  | 1829 | use constant IS_CONFOBJ     => sub { UNIVERSAL::isa($_[-1], | 
| 83 | 20 |  |  | 20 |  | 40 | 'CPANPLUS::Configure') }; | 
|  | 20 |  |  |  |  | 855 |  | 
|  | 20 |  |  |  |  | 129 |  | 
| 84 |  |  |  |  |  |  |  | 
| 85 | 1 |  |  |  |  | 37 | use constant IS_RVOBJ       => sub { UNIVERSAL::isa($_[-1], | 
| 86 | 20 |  |  | 20 |  | 48 | 'CPANPLUS::Backend::RV') }; | 
|  | 20 |  |  |  |  | 1203 |  | 
|  | 20 |  |  |  |  | 135 |  | 
| 87 |  |  |  |  |  |  |  | 
| 88 |  |  |  |  |  |  | use constant IS_INTERNALS_OBJ | 
| 89 | 20 |  |  |  |  | 35 | => sub { UNIVERSAL::isa($_[-1], | 
| 90 | 20 |  |  | 20 |  | 38 | 'CPANPLUS::Internals') }; | 
|  | 20 |  |  |  |  | 1078 |  | 
|  | 20 |  |  |  |  | 126 |  | 
| 91 |  |  |  |  |  |  |  | 
| 92 | 20 | 100 |  | 20 |  | 999 | use constant IS_FILE        => sub { return 1 if -e $_[-1] }; | 
|  | 20 |  |  |  |  | 122 |  | 
|  | 20 |  |  |  |  | 38 |  | 
|  | 20 |  |  |  |  | 986 |  | 
| 93 |  |  |  |  |  |  |  | 
| 94 |  |  |  |  |  |  | use constant FILE_EXISTS    => sub { | 
| 95 | 20 |  |  |  |  | 151 | my $file = $_[-1]; | 
| 96 | 20 | 100 |  |  |  | 59 | return 1 if IS_FILE->($file); | 
| 97 | 20 |  |  |  |  | 1056 | local $Carp::CarpLevel = | 
| 98 |  |  |  |  |  |  | $Carp::CarpLevel+2; | 
| 99 | 20 |  |  |  |  | 133 | error(loc(  q[File '%1' does not exist], | 
| 100 |  |  |  |  |  |  | $file)); | 
| 101 | 20 |  |  |  |  | 100 | return; | 
| 102 | 20 |  |  | 20 |  | 166 | }; | 
|  | 20 |  |  |  |  | 47 |  | 
|  | 20 |  |  |  |  | 1014 |  | 
| 103 |  |  |  |  |  |  |  | 
| 104 |  |  |  |  |  |  | use constant FILE_READABLE  => sub { | 
| 105 | 20 |  |  |  |  | 1025 | my $file = $_[-1]; | 
| 106 | 20 | 50 | 33 |  |  | 134 | return 1 if -e $file && -r _; | 
| 107 | 20 |  |  |  |  | 30 | local $Carp::CarpLevel = | 
| 108 |  |  |  |  |  |  | $Carp::CarpLevel+2; | 
| 109 | 20 |  |  |  |  | 1160 | error( loc( q[File '%1' is not readable ]. | 
| 110 |  |  |  |  |  |  | q[or does not exist], $file)); | 
| 111 | 20 |  |  |  |  | 134 | return; | 
| 112 | 20 |  |  | 20 |  | 1097 | }; | 
|  | 20 |  |  |  |  | 176 |  | 
|  | 20 |  |  |  |  | 36 |  | 
| 113 | 20 | 50 |  | 20 |  | 46 | use constant IS_DIR         => sub { return 1 if -d $_[-1] }; | 
|  | 20 |  |  |  |  | 954 |  | 
|  | 20 |  |  |  |  | 122 |  | 
|  | 20 |  |  |  |  | 39 |  | 
| 114 |  |  |  |  |  |  |  | 
| 115 |  |  |  |  |  |  | use constant DIR_EXISTS     => sub { | 
| 116 | 20 |  |  |  |  | 1033 | my $dir = $_[-1]; | 
| 117 | 20 | 100 |  |  |  | 139 | return 1 if IS_DIR->($dir); | 
| 118 | 20 |  |  |  |  | 43 | local $Carp::CarpLevel = | 
| 119 |  |  |  |  |  |  | $Carp::CarpLevel+2; | 
| 120 | 20 |  |  |  |  | 1019 | error(loc(q[Dir '%1' does not exist], | 
| 121 |  |  |  |  |  |  | $dir)); | 
| 122 | 20 |  |  |  |  | 153 | return; | 
| 123 | 20 |  |  | 20 |  | 984 | }; | 
|  | 20 |  |  |  |  | 119 |  | 
|  | 20 |  |  |  |  | 41 |  | 
| 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 |  |  |  |  | 53 | $Config::Config{make} =~ /MM[S|K]/i) | 
| 130 |  |  |  |  |  |  | ? 'DESCRIP.MMS' | 
| 131 |  |  |  |  |  |  | : 'Makefile'; | 
| 132 |  |  |  |  |  |  |  | 
| 133 |  |  |  |  |  |  | return @_ | 
| 134 | 20 | 100 |  |  |  | 1196 | ? File::Spec->catfile( @_, $file ) | 
| 135 |  |  |  |  |  |  | : $file; | 
| 136 | 20 |  |  | 20 |  | 63 | }; | 
|  | 20 |  |  |  |  | 1440 |  | 
|  | 20 |  |  |  |  | 139 |  | 
| 137 |  |  |  |  |  |  | use constant MAKEFILE_PL    => sub { return @_ | 
| 138 | 20 | 100 |  |  |  | 120 | ? File::Spec->catfile( @_, | 
| 139 |  |  |  |  |  |  | 'Makefile.PL' ) | 
| 140 |  |  |  |  |  |  | : 'Makefile.PL'; | 
| 141 | 20 |  |  | 20 |  | 143 | }; | 
|  | 20 |  |  |  |  | 34 |  | 
|  | 20 |  |  |  |  | 1246 |  | 
| 142 |  |  |  |  |  |  | use constant BUILD_PL       => sub { return @_ | 
| 143 | 20 | 100 |  |  |  | 50 | ? File::Spec->catfile( @_, | 
| 144 |  |  |  |  |  |  | 'Build.PL' ) | 
| 145 |  |  |  |  |  |  | : 'Build.PL'; | 
| 146 | 20 |  |  | 20 |  | 47 | }; | 
|  | 20 |  |  |  |  | 1215 |  | 
|  | 20 |  |  |  |  | 132 |  | 
| 147 |  |  |  |  |  |  |  | 
| 148 |  |  |  |  |  |  | use constant META_YML       => sub { return @_ | 
| 149 | 20 | 100 |  |  |  | 1171 | ? File::Spec->catfile( @_, 'META.yml' ) | 
| 150 |  |  |  |  |  |  | : 'META.yml'; | 
| 151 | 20 |  |  | 20 |  | 1166 | }; | 
|  | 20 |  |  |  |  | 124 |  | 
|  | 20 |  |  |  |  | 40 |  | 
| 152 |  |  |  |  |  |  |  | 
| 153 |  |  |  |  |  |  | use constant MYMETA_YML     => sub { return @_ | 
| 154 | 20 | 50 |  |  |  | 120 | ? File::Spec->catfile( @_, 'MYMETA.yml' ) | 
| 155 |  |  |  |  |  |  | : 'MYMETA.yml'; | 
| 156 | 20 |  |  | 20 |  | 126 | }; | 
|  | 20 |  |  |  |  | 47 |  | 
|  | 20 |  |  |  |  | 1015 |  | 
| 157 |  |  |  |  |  |  |  | 
| 158 |  |  |  |  |  |  | use constant META_JSON       => sub { return @_ | 
| 159 | 20 | 50 |  |  |  | 63 | ? File::Spec->catfile( @_, 'META.json' ) | 
| 160 |  |  |  |  |  |  | : 'META.json'; | 
| 161 | 20 |  |  | 20 |  | 56 | }; | 
|  | 20 |  |  |  |  | 1188 |  | 
|  | 20 |  |  |  |  | 193 |  | 
| 162 |  |  |  |  |  |  |  | 
| 163 |  |  |  |  |  |  | use constant MYMETA_JSON     => sub { return @_ | 
| 164 | 20 | 50 |  |  |  | 996 | ? File::Spec->catfile( @_, 'MYMETA.json' ) | 
| 165 |  |  |  |  |  |  | : 'MYMETA.json'; | 
| 166 | 20 |  |  | 20 |  | 1094 | }; | 
|  | 20 |  |  |  |  | 127 |  | 
|  | 20 |  |  |  |  | 50 |  | 
| 167 |  |  |  |  |  |  |  | 
| 168 |  |  |  |  |  |  | use constant BLIB           => sub { return @_ | 
| 169 | 20 | 50 |  |  |  | 180 | ? File::Spec->catfile(@_, 'blib') | 
| 170 |  |  |  |  |  |  | : 'blib'; | 
| 171 | 20 |  |  | 20 |  | 155 | }; | 
|  | 20 |  |  |  |  | 44 |  | 
|  | 20 |  |  |  |  | 2113 |  | 
| 172 |  |  |  |  |  |  |  | 
| 173 | 20 |  |  | 20 |  | 48 | use constant LIB            => 'lib'; | 
|  | 20 |  |  |  |  | 1667 |  | 
|  | 11 |  |  |  |  | 234 |  | 
| 174 |  |  |  |  |  |  | use constant LIB_DIR        => sub { return @_ | 
| 175 | 20 | 100 |  |  |  | 1703 | ? File::Spec->catdir(@_, LIB) | 
| 176 |  |  |  |  |  |  | : LIB; | 
| 177 | 0 |  |  | 20 |  | 0 | }; | 
|  | 20 |  |  |  |  | 136 |  | 
|  | 20 |  |  |  |  | 41 |  | 
| 178 | 2 |  |  | 20 |  | 258 | use constant AUTO           => 'auto'; | 
|  | 20 |  |  |  |  | 167 |  | 
|  | 20 |  |  |  |  | 39 |  | 
| 179 |  |  |  |  |  |  | use constant LIB_AUTO_DIR   => sub { return @_ | 
| 180 | 20 | 50 |  |  |  | 1793 | ? File::Spec->catdir(@_, LIB, AUTO) | 
| 181 |  |  |  |  |  |  | : File::Spec->catdir(LIB, AUTO) | 
| 182 | 20 |  |  | 20 |  | 1736 | }; | 
|  | 183 |  |  |  |  | 22954 |  | 
|  | 20 |  |  |  |  | 37 |  | 
| 183 | 20 |  |  | 20 |  | 134 | use constant ARCH           => 'arch'; | 
|  | 20 |  |  |  |  | 35 |  | 
|  | 20 |  |  |  |  | 1721 |  | 
| 184 |  |  |  |  |  |  | use constant ARCH_DIR       => sub { return @_ | 
| 185 | 0 | 0 |  |  |  | 0 | ? File::Spec->catdir(@_, ARCH) | 
| 186 |  |  |  |  |  |  | : ARCH; | 
| 187 | 363 |  |  | 20 |  | 82388 | }; | 
|  | 20 |  |  |  |  | 40 |  | 
|  | 20 |  |  |  |  | 1553 |  | 
| 188 |  |  |  |  |  |  | use constant ARCH_AUTO_DIR  => sub { return @_ | 
| 189 | 44 | 0 |  |  |  | 2484 | ? File::Spec->catdir(@_,ARCH,AUTO) | 
| 190 |  |  |  |  |  |  | : File::Spec->catdir(ARCH,AUTO) | 
| 191 | 20 |  |  | 20 |  | 132 | }; | 
|  | 20 |  |  |  |  | 40 |  | 
|  | 20 |  |  |  |  | 1655 |  | 
| 192 |  |  |  |  |  |  |  | 
| 193 |  |  |  |  |  |  | use constant BLIB_LIBDIR    => sub { return @_ | 
| 194 | 20 | 0 |  |  |  | 54 | ? File::Spec->catdir( | 
| 195 |  |  |  |  |  |  | @_, BLIB->(), LIB ) | 
| 196 |  |  |  |  |  |  | : File::Spec->catdir( BLIB->(), LIB ); | 
| 197 | 20 |  |  | 20 |  | 41 | }; | 
|  | 20 |  |  |  |  | 1621 |  | 
|  | 20 |  |  |  |  | 134 |  | 
| 198 |  |  |  |  |  |  |  | 
| 199 | 20 |  |  | 20 |  | 1803 | use constant BIN            => 'bin'; | 
|  | 15 |  |  |  |  | 365 |  | 
|  | 20 |  |  |  |  | 157 |  | 
| 200 |  |  |  |  |  |  |  | 
| 201 | 20 |  |  | 20 |  | 70 | use constant SCRIPT         => 'script'; | 
|  | 20 |  |  |  |  | 2619 |  | 
|  | 290 |  |  |  |  | 20747 |  | 
| 202 |  |  |  |  |  |  |  | 
| 203 |  |  |  |  |  |  | use constant CONFIG_USER_LIB_DIR => sub { | 
| 204 | 98 |  |  |  |  | 9891 | require CPANPLUS::Internals::Utils; | 
| 205 | 98 |  |  |  |  | 756 | LIB_DIR->( | 
| 206 |  |  |  |  |  |  | CPANPLUS::Internals::Utils->_home_dir, | 
| 207 |  |  |  |  |  |  | DOT_CPANPLUS | 
| 208 |  |  |  |  |  |  | ); | 
| 209 | 20 |  |  | 20 |  | 139 | }; | 
|  | 20 |  |  |  |  | 47 |  | 
|  | 20 |  |  |  |  | 2450 |  | 
| 210 |  |  |  |  |  |  | use constant CONFIG_USER_FILE    => sub { | 
| 211 | 20 |  |  |  |  | 145 | 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 |  |  |  |  | 1016 | 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 |  | 34 | }; | 
|  | 20 |  |  |  |  | 1722 |  | 
|  | 22 |  |  |  |  | 1942 |  | 
| 228 |  |  |  |  |  |  |  | 
| 229 | 88 |  |  |  |  | 3236 | use constant README         => sub { my $obj = $_[0]; | 
| 230 | 20 |  |  |  |  | 156 | my $pkg = $obj->package_name; | 
| 231 | 20 |  |  |  |  | 55 | $pkg .= '-' . $obj->package_version . | 
| 232 |  |  |  |  |  |  | '.readme'; | 
| 233 | 20 |  |  |  |  | 2895 | return $pkg; | 
| 234 | 20 |  |  | 20 |  | 139 | }; | 
|  | 20 |  |  |  |  | 45 |  | 
|  | 20 |  |  |  |  | 2300 |  | 
| 235 | 71 |  |  | 20 |  | 8150 | use constant META_EXT       => 'meta'; | 
|  | 71 |  |  |  |  | 779 |  | 
|  | 1 |  |  |  |  | 37 |  | 
| 236 |  |  |  |  |  |  |  | 
| 237 | 20 |  |  |  |  | 46 | use constant META           => sub { my $obj = $_[0]; | 
| 238 | 20 |  |  |  |  | 1871 | my $pkg = $obj->package_name; | 
| 239 | 6 |  |  |  |  | 394 | $pkg .= '-' . $obj->package_version . | 
| 240 |  |  |  |  |  |  | '.' . META_EXT; | 
| 241 | 6 |  |  |  |  | 392 | return $pkg; | 
| 242 | 1 |  |  | 20 |  | 33 | }; | 
|  | 1 |  |  |  |  | 28 |  | 
|  | 20 |  |  |  |  | 152 |  | 
| 243 |  |  |  |  |  |  |  | 
| 244 |  |  |  |  |  |  | use constant OPEN_FILE      => sub { | 
| 245 | 21 |  |  |  |  | 2208 | my($file, $mode) = (@_, ''); | 
| 246 | 20 |  |  |  |  | 526 | my $fh; | 
| 247 | 20 | 0 |  |  |  | 348 | open $fh, "$mode" . $file | 
| 248 |  |  |  |  |  |  | or error(loc( | 
| 249 |  |  |  |  |  |  | "Could not open file '%1': %2", | 
| 250 |  |  |  |  |  |  | $file, $!)); | 
| 251 | 20 | 50 |  |  |  | 1586 | return $fh if $fh; | 
| 252 | 21 |  |  |  |  | 2671 | return; | 
| 253 | 20 |  |  | 20 |  | 146 | }; | 
|  | 20 |  |  |  |  | 46 |  | 
|  | 20 |  |  |  |  | 1673 |  | 
| 254 |  |  |  |  |  |  |  | 
| 255 |  |  |  |  |  |  | use constant OPEN_DIR       => sub { | 
| 256 | 27 |  |  |  |  | 2702 | my $dir = shift; | 
| 257 | 20 |  |  |  |  | 137 | my $dh; | 
| 258 | 20 | 50 |  |  |  | 41 | opendir $dh, $dir or error(loc( | 
| 259 |  |  |  |  |  |  | "Could not open dir '%1': %2", $dir, $! | 
| 260 |  |  |  |  |  |  | )); | 
| 261 |  |  |  |  |  |  |  | 
| 262 | 20 | 50 |  |  |  | 1714 | return $dh if $dh; | 
| 263 | 3 |  |  |  |  | 414 | return; | 
| 264 | 20 |  |  | 20 |  | 130 | }; | 
|  | 20 |  |  |  |  | 32 |  | 
|  | 20 |  |  |  |  | 1618 |  | 
| 265 |  |  |  |  |  |  |  | 
| 266 |  |  |  |  |  |  | use constant READ_DIR       => sub { | 
| 267 | 21 |  |  |  |  | 2367 | my $dir = shift; | 
| 268 | 20 | 50 |  |  |  | 141 | my $dh  = OPEN_DIR->( $dir ) or return; | 
| 269 |  |  |  |  |  |  |  | 
| 270 |  |  |  |  |  |  | ### exclude . and .. | 
| 271 | 20 |  |  |  |  | 38 | my @files =  grep { $_ !~ /^\.{1,2}/ } | 
|  | 20 |  |  |  |  | 1596 |  | 
| 272 |  |  |  |  |  |  | readdir($dh); | 
| 273 |  |  |  |  |  |  |  | 
| 274 |  |  |  |  |  |  | ### Remove trailing dot on VMS when | 
| 275 |  |  |  |  |  |  | ### using VMS syntax. | 
| 276 | 3 |  |  |  |  | 333 | if( ON_VMS ) { | 
| 277 |  |  |  |  |  |  | s/(? | 
| 278 |  |  |  |  |  |  | } | 
| 279 |  |  |  |  |  |  |  | 
| 280 | 20 |  |  |  |  | 131 | return @files; | 
| 281 | 20 |  |  | 20 |  | 171 | }; | 
|  | 20 |  |  |  |  | 41 |  | 
|  | 20 |  |  |  |  | 1664 |  | 
| 282 |  |  |  |  |  |  |  | 
| 283 |  |  |  |  |  |  | use constant STRIP_GZ_SUFFIX | 
| 284 |  |  |  |  |  |  | => sub { | 
| 285 | 20 | 50 |  |  |  | 125 | my $file = $_[0] or return; | 
| 286 | 20 |  |  |  |  | 45 | $file =~ s/.gz$//i; | 
| 287 | 20 |  |  |  |  | 1821 | return $file; | 
| 288 | 20 |  |  | 20 |  | 37 | }; | 
|  | 20 |  |  |  |  | 1165 |  | 
|  | 59 |  |  |  |  | 4155 |  | 
| 289 |  |  |  |  |  |  |  | 
| 290 | 20 |  |  | 20 |  | 147 | use constant CHECKSUMS      => 'CHECKSUMS'; | 
|  | 20 |  |  |  |  | 38 |  | 
|  | 20 |  |  |  |  | 1439 |  | 
| 291 | 7 |  |  | 20 |  | 164 | use constant PGP_HEADER     => '-----BEGIN PGP SIGNED MESSAGE-----'; | 
|  | 20 |  |  |  |  | 160 |  | 
|  | 20 |  |  |  |  | 37 |  | 
| 292 | 20 |  |  |  |  | 40 | use constant ENV_CPANPLUS_CONFIG | 
| 293 | 20 |  |  | 20 |  | 1978 | => 'PERL5_CPANPLUS_CONFIG'; | 
|  | 20 |  |  |  |  | 158 |  | 
| 294 | 20 |  |  |  |  | 150 | use constant ENV_CPANPLUS_IS_EXECUTING | 
| 295 | 20 |  |  | 20 |  | 1328 | => 'PERL5_CPANPLUS_IS_EXECUTING'; | 
|  | 0 |  |  |  |  | 0 |  | 
| 296 | 20 |  |  | 20 |  | 37 | use constant DEFAULT_EMAIL  => 'cpanplus@example.com'; | 
|  | 20 |  |  |  |  | 1498 |  | 
|  | 20 |  |  |  |  | 125 |  | 
| 297 |  |  |  |  |  |  | use constant CPANPLUS_UA    => sub { ### for the version number ### | 
| 298 | 20 |  |  |  |  | 147 | require CPANPLUS::Internals; | 
| 299 | 20 |  |  |  |  | 57 | "CPANPLUS/$CPANPLUS::Internals::VERSION" | 
| 300 | 20 |  |  | 20 |  | 56 | }; | 
|  | 20 |  |  |  |  | 2644 |  | 
|  | 0 |  |  |  |  | 0 |  | 
| 301 |  |  |  |  |  |  | use constant TESTERS_URL    => sub { | 
| 302 | 20 |  |  |  |  | 39 | 'http://cpantesters.org/distro/'. | 
| 303 |  |  |  |  |  |  | uc(substr($_[0],0,1)) .'/'. $_[0] . '.yaml'; | 
| 304 | 20 |  |  | 20 |  | 1951 | }; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 20 |  |  |  |  | 137 |  | 
| 305 |  |  |  |  |  |  | use constant TESTERS_DETAILS_URL | 
| 306 |  |  |  |  |  |  | => sub { | 
| 307 | 20 |  |  |  |  | 37 | 'http://cpantesters.org/distro/'. | 
| 308 |  |  |  |  |  |  | uc(substr($_[0],0,1)) .'/'. $_[0]; | 
| 309 | 20 |  |  | 20 |  | 1247 | }; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 20 |  |  |  |  | 129 |  | 
| 310 |  |  |  |  |  |  |  | 
| 311 |  |  |  |  |  |  | use constant CREATE_FILE_URI | 
| 312 |  |  |  |  |  |  | => sub { | 
| 313 | 20 | 50 |  |  |  | 1722 | my $dir = $_[0] or return; | 
| 314 | 20 | 50 |  |  |  | 145 | return $dir =~ m|^/| | 
| 315 |  |  |  |  |  |  | ? 'file://'  . $dir | 
| 316 |  |  |  |  |  |  | : 'file:///' . $dir; | 
| 317 | 20 |  |  | 20 |  | 1074 | }; | 
|  | 20 |  |  |  |  | 133 |  | 
|  | 20 |  |  |  |  | 44 |  | 
| 318 |  |  |  |  |  |  |  | 
| 319 | 20 |  |  | 20 |  | 50 | use constant EMPTY_DSLIP    => '     '; | 
|  | 20 |  |  |  |  | 2007 |  | 
|  | 0 |  |  |  |  | 0 |  | 
| 320 |  |  |  |  |  |  |  | 
| 321 | 20 |  |  |  |  | 36 | use constant CUSTOM_AUTHOR_ID | 
| 322 | 0 |  |  | 20 |  | 0 | => 'LOCAL'; | 
|  | 20 |  |  |  |  | 149 |  | 
| 323 |  |  |  |  |  |  |  | 
| 324 | 20 |  |  |  |  | 139 | use constant DOT_SHELL_DEFAULT_RC | 
| 325 | 20 |  |  | 20 |  | 2411 | => '.shell-default.rc'; | 
|  | 0 |  |  |  |  | 0 |  | 
| 326 |  |  |  |  |  |  |  | 
| 327 | 0 |  |  |  |  | 0 | use constant SOURCE_SQLITE_DB | 
| 328 | 20 |  |  | 20 |  | 47 | => 'db.sql'; | 
|  | 20 |  |  |  |  | 2158 |  | 
| 329 |  |  |  |  |  |  |  | 
| 330 | 0 |  |  | 20 |  | 0 | use constant PREREQ_IGNORE  => 0; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 0 |  |  |  |  | 0 |  | 
| 331 | 20 |  |  | 20 |  | 138 | use constant PREREQ_INSTALL => 1; | 
|  | 20 |  |  |  |  | 46 |  | 
|  | 20 |  |  |  |  | 1210 |  | 
| 332 | 2 |  |  | 20 |  | 9 | use constant PREREQ_ASK     => 2; | 
|  | 2 |  |  |  |  | 25 |  | 
|  | 2 |  |  |  |  | 18 |  | 
| 333 | 2 |  |  | 20 |  | 9 | use constant PREREQ_BUILD   => 3; | 
|  | 20 |  |  |  |  | 146 |  | 
|  | 20 |  |  |  |  | 37 |  | 
| 334 | 20 |  |  | 20 |  | 2327 | use constant BOOLEANS       => [0,1]; | 
|  | 20 |  |  |  |  | 136 |  | 
|  | 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 |  | 2724 | }; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 0 |  |  |  |  | 0 |  | 
| 339 | 20 |  |  | 20 |  | 143 | use constant PERL_CORE      => 'perl'; | 
|  | 20 |  |  |  |  | 41 |  | 
|  | 20 |  |  |  |  | 2231 |  | 
| 340 | 86 |  |  | 20 |  | 1177 | use constant PERL_WRAPPER   => 'use strict; BEGIN { my $old = select STDERR; $|++; select $old; $|++; $0 = shift(@ARGV); my $rv = do($0); die $@ if $@; }'; | 
|  | 86 |  |  |  |  | 421 |  | 
|  | 86 |  |  |  |  | 6414 |  | 
| 341 | 86 |  |  | 20 |  | 1253 | use constant STORABLE_EXT   => '.stored'; | 
|  | 0 |  |  |  |  | 0 |  | 
|  | 20 |  |  |  |  | 136 |  | 
| 342 |  |  |  |  |  |  |  | 
| 343 | 7 | 50 |  |  |  | 15 | use constant GET_XS_FILES   => sub { my $dir = $_[0] or return; | 
| 344 | 7 |  |  |  |  | 483 | require File::Find; | 
| 345 | 7 |  |  |  |  | 75 | my @files; | 
| 346 |  |  |  |  |  |  | File::Find::find( | 
| 347 | 20 | 0 |  |  |  | 149 | sub { push @files, $File::Find::name | 
| 348 |  |  |  |  |  |  | if $File::Find::name =~ /\.xs$/i | 
| 349 | 0 |  |  |  |  | 0 | }, $dir ); | 
| 350 |  |  |  |  |  |  |  | 
| 351 | 20 |  |  |  |  | 58 | return @files; | 
| 352 | 20 |  |  | 20 |  | 40 | }; | 
|  | 20 |  |  |  |  | 4130 |  | 
|  | 7 |  |  |  |  | 24 |  | 
| 353 |  |  |  |  |  |  |  | 
| 354 |  |  |  |  |  |  | use constant INSTALL_LOG_FILE | 
| 355 | 7 | 0 |  |  |  | 243 | => sub { my $obj  = shift or return; | 
| 356 | 21 |  |  |  |  | 170 | my $name = $obj->name; $name =~ s/::/-/g; | 
|  | 7 |  |  |  |  | 18 |  | 
| 357 | 7 |  |  |  |  | 189 | $name .= '-'. $obj->version; | 
| 358 | 20 |  |  |  |  | 164 | $name .= '-'. scalar(time) . '.log'; | 
| 359 | 20 |  |  |  |  | 47 | return $name; | 
| 360 | 20 |  |  | 20 |  | 2300 | }; | 
|  | 7 |  |  |  |  | 41 |  | 
|  | 7 |  |  |  |  | 57 |  | 
| 361 |  |  |  |  |  |  |  | 
| 362 | 62 |  |  |  |  | 874 | use constant ON_OLD_CYGWIN  => do { ON_CYGWIN and $] < 5.008 | 
|  | 62 |  |  |  |  | 306 |  | 
| 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 |  | 1093 | }; | 
|  | 62 |  |  |  |  | 366 |  | 
| 369 |  |  |  |  |  |  |  | 
| 370 |  |  |  |  |  |  | ### XXX these 2 are probably obsolete -- check & remove; | 
| 371 | 20 |  |  | 20 |  | 120 | use constant DOT_EXISTS     => '.exists'; | 
|  | 20 |  |  |  |  | 37 |  | 
|  | 20 |  |  |  |  | 989 |  | 
| 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 |  |  |  |  | 1056 | return qq['$line']; | 
| 382 | 20 |  |  | 20 |  | 122 | }; | 
|  | 20 |  |  |  |  | 40 |  | 
|  | 20 |  |  |  |  | 986 |  | 
| 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: |