Codebase list libcpan-mini-perl / 069b8f7
Imported Upstream version 1.111013 gregor herrmann 10 years ago
16 changed file(s) with 662 addition(s) and 225 deletion(s). Raw diff Collapse all Expand all
00 Revision history for CPAN-Mini
1
2 1.111013 2013-04-13 14:02:58 Europe/London
3 make www.cpan.org the default remote!
4
5 link to the list of mirrors, too (thanks, SYSMON!)
6
7 pass all options from command line, not just known ones (thanks,
8 Jeffrey Thalhammer, who waited a very very long time for me to apply
9 this!)
10
11 add --remote-from option to get remote from CPAN or CPANPLUS config
12 (thanks, Jeff Bisbee, who also waited a long time)
13
14 expand leading "~" in config file name (suggested by justincase)
15
16 die if local target isn't writable (suggested by SARGIE)
17
18 1.111012 2013-03-28 16:32:58 America/New_York
19 when testing, mock my_home harder (thanks, David Golden!)
20
21 1.111011 2013-02-07 16:40:23 America/New_York
22 check that the received 02packages seems at least remotely plausible
23
24 1.111010 2012-10-24 10:46:35 America/New_York
25 fix the old ->trace method, broken in 1.111004
26
27 1.111009 2012-08-27 21:32:39 America/New_York
28 config options that once had to be specified as multiple entries
29 on one line may now be given as repeated entries; these are
30 also_mirror, module_filters, and path_filters
131
232 1.111008 2011-12-23 13:36:41 America/New_York
333 don't fail tests when the outside env has set CPAN_MINI_CONFIG
99 dist.ini
1010 lib/CPAN/Mini.pm
1111 lib/CPAN/Mini/App.pm
12 t/00-compile.t
1213 t/00-load.t
14 t/000-report-versions-tiny.t
1315 t/app.t
1416 t/config-file.t
1517 t/filter.t
16 t/release-pod-syntax.t
1718 xt/fake.t
19 xt/release/changes_has_content.t
20 xt/release/pod-syntax.t
44 "Randal Schwartz <merlyn@stonehenge.com>"
55 ],
66 "dynamic_config" : 0,
7 "generated_by" : "Dist::Zilla version 4.300005, CPAN::Meta::Converter version 2.112621",
7 "generated_by" : "Dist::Zilla version 4.300033, CPAN::Meta::Converter version 2.130880",
88 "license" : [
99 "perl_5"
1010 ],
1919 "ExtUtils::MakeMaker" : "6.30"
2020 }
2121 },
22 "develop" : {
23 "requires" : {
24 "Test::Pod" : "1.41",
25 "version" : "0.9901"
26 }
27 },
2228 "runtime" : {
2329 "requires" : {
24 "Carp" : 0,
30 "CPAN" : "0",
31 "CPANPLUS::Backend" : "0",
32 "Carp" : "0",
2533 "Compress::Zlib" : "1.20",
26 "File::Basename" : 0,
27 "File::Copy" : 0,
28 "File::Find" : 0,
34 "File::Basename" : "0",
35 "File::Copy" : "0",
36 "File::Find" : "0",
2937 "File::HomeDir" : "0.57",
3038 "File::Path" : "2.04",
31 "File::Spec" : 0,
32 "File::Temp" : 0,
33 "Getopt::Long" : 0,
39 "File::Spec" : "0",
40 "File::Temp" : "0",
41 "Getopt::Long" : "0",
3442 "LWP::UserAgent" : "5",
3543 "Pod::Usage" : "1.00",
3644 "URI" : "1",
3745 "perl" : "5.006",
38 "strict" : 0,
39 "warnings" : 0
46 "strict" : "0",
47 "warnings" : "0"
4048 }
4149 },
4250 "test" : {
5462 "web" : "https://github.com/rjbs/cpan-mini"
5563 }
5664 },
57 "version" : "1.111008",
65 "version" : "1.111013",
5866 "x_Dist_Zilla" : {
67 "perl" : {
68 "version" : "5.017010"
69 },
5970 "plugins" : [
71 {
72 "class" : "Dist::Zilla::Plugin::Git::GatherDir",
73 "name" : "@RJBS/Git::GatherDir",
74 "version" : "2.012"
75 },
6076 {
6177 "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
6278 "name" : "@RJBS/CheckPrereqsIndexed",
63 "version" : "0.007"
64 },
65 {
66 "class" : "Dist::Zilla::Plugin::GatherDir",
67 "name" : "@RJBS/@Basic/GatherDir",
68 "version" : "4.300005"
79 "version" : "0.008"
80 },
81 {
82 "class" : "Dist::Zilla::Plugin::CheckExtraTests",
83 "name" : "@RJBS/CheckExtraTests",
84 "version" : "0.011"
6985 },
7086 {
7187 "class" : "Dist::Zilla::Plugin::PruneCruft",
72 "name" : "@RJBS/@Basic/PruneCruft",
73 "version" : "4.300005"
88 "name" : "@RJBS/@Filter/PruneCruft",
89 "version" : "4.300033"
7490 },
7591 {
7692 "class" : "Dist::Zilla::Plugin::ManifestSkip",
77 "name" : "@RJBS/@Basic/ManifestSkip",
78 "version" : "4.300005"
93 "name" : "@RJBS/@Filter/ManifestSkip",
94 "version" : "4.300033"
7995 },
8096 {
8197 "class" : "Dist::Zilla::Plugin::MetaYAML",
82 "name" : "@RJBS/@Basic/MetaYAML",
83 "version" : "4.300005"
98 "name" : "@RJBS/@Filter/MetaYAML",
99 "version" : "4.300033"
84100 },
85101 {
86102 "class" : "Dist::Zilla::Plugin::License",
87 "name" : "@RJBS/@Basic/License",
88 "version" : "4.300005"
103 "name" : "@RJBS/@Filter/License",
104 "version" : "4.300033"
89105 },
90106 {
91107 "class" : "Dist::Zilla::Plugin::Readme",
92 "name" : "@RJBS/@Basic/Readme",
93 "version" : "4.300005"
94 },
95 {
96 "class" : "Dist::Zilla::Plugin::ExtraTests",
97 "name" : "@RJBS/@Basic/ExtraTests",
98 "version" : "4.300005"
108 "name" : "@RJBS/@Filter/Readme",
109 "version" : "4.300033"
99110 },
100111 {
101112 "class" : "Dist::Zilla::Plugin::ExecDir",
102 "name" : "@RJBS/@Basic/ExecDir",
103 "version" : "4.300005"
113 "name" : "@RJBS/@Filter/ExecDir",
114 "version" : "4.300033"
104115 },
105116 {
106117 "class" : "Dist::Zilla::Plugin::ShareDir",
107 "name" : "@RJBS/@Basic/ShareDir",
108 "version" : "4.300005"
118 "name" : "@RJBS/@Filter/ShareDir",
119 "version" : "4.300033"
109120 },
110121 {
111122 "class" : "Dist::Zilla::Plugin::MakeMaker",
112 "name" : "@RJBS/@Basic/MakeMaker",
113 "version" : "4.300005"
123 "name" : "@RJBS/@Filter/MakeMaker",
124 "version" : "4.300033"
114125 },
115126 {
116127 "class" : "Dist::Zilla::Plugin::Manifest",
117 "name" : "@RJBS/@Basic/Manifest",
118 "version" : "4.300005"
128 "name" : "@RJBS/@Filter/Manifest",
129 "version" : "4.300033"
119130 },
120131 {
121132 "class" : "Dist::Zilla::Plugin::TestRelease",
122 "name" : "@RJBS/@Basic/TestRelease",
123 "version" : "4.300005"
133 "name" : "@RJBS/@Filter/TestRelease",
134 "version" : "4.300033"
124135 },
125136 {
126137 "class" : "Dist::Zilla::Plugin::ConfirmRelease",
127 "name" : "@RJBS/@Basic/ConfirmRelease",
128 "version" : "4.300005"
138 "name" : "@RJBS/@Filter/ConfirmRelease",
139 "version" : "4.300033"
129140 },
130141 {
131142 "class" : "Dist::Zilla::Plugin::UploadToCPAN",
132 "name" : "@RJBS/@Basic/UploadToCPAN",
133 "version" : "4.300005"
143 "name" : "@RJBS/@Filter/UploadToCPAN",
144 "version" : "4.300033"
134145 },
135146 {
136147 "class" : "Dist::Zilla::Plugin::AutoPrereqs",
137148 "name" : "@RJBS/AutoPrereqs",
138 "version" : "4.300005"
149 "version" : "4.300033"
139150 },
140151 {
141152 "class" : "Dist::Zilla::Plugin::Git::NextVersion",
142153 "name" : "@RJBS/Git::NextVersion",
143 "version" : "1.113560"
154 "version" : "2.012"
144155 },
145156 {
146157 "class" : "Dist::Zilla::Plugin::PkgVersion",
147158 "name" : "@RJBS/PkgVersion",
148 "version" : "4.300005"
159 "version" : "4.300033"
149160 },
150161 {
151162 "class" : "Dist::Zilla::Plugin::MetaConfig",
152163 "name" : "@RJBS/MetaConfig",
153 "version" : "4.300005"
164 "version" : "4.300033"
154165 },
155166 {
156167 "class" : "Dist::Zilla::Plugin::MetaJSON",
157168 "name" : "@RJBS/MetaJSON",
158 "version" : "4.300005"
169 "version" : "4.300033"
159170 },
160171 {
161172 "class" : "Dist::Zilla::Plugin::NextRelease",
162173 "name" : "@RJBS/NextRelease",
163 "version" : "4.300005"
174 "version" : "4.300033"
175 },
176 {
177 "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent",
178 "name" : "@RJBS/Test::ChangesHasContent",
179 "version" : "0.006"
164180 },
165181 {
166182 "class" : "Dist::Zilla::Plugin::PodSyntaxTests",
167183 "name" : "@RJBS/PodSyntaxTests",
168 "version" : "4.300005"
169 },
170 {
171 "class" : "Dist::Zilla::Plugin::Repository",
172 "name" : "@RJBS/Repository",
173 "version" : "0.18"
184 "version" : "4.300033"
185 },
186 {
187 "class" : "Dist::Zilla::Plugin::Test::Compile",
188 "name" : "@RJBS/Test::Compile",
189 "version" : "2.001"
190 },
191 {
192 "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny",
193 "name" : "@RJBS/ReportVersions::Tiny",
194 "version" : "1.08"
174195 },
175196 {
176197 "class" : "Dist::Zilla::Plugin::Prereqs",
181202 }
182203 },
183204 "name" : "@RJBS/TestMoreWithSubtests",
184 "version" : "4.300005"
205 "version" : "4.300033"
185206 },
186207 {
187208 "class" : "Dist::Zilla::Plugin::PodWeaver",
196217 {
197218 "class" : "Dist::Zilla::Plugin::Git::Check",
198219 "name" : "@RJBS/@Git/Check",
199 "version" : "1.113560"
220 "version" : "2.012"
200221 },
201222 {
202223 "class" : "Dist::Zilla::Plugin::Git::Commit",
203224 "name" : "@RJBS/@Git/Commit",
204 "version" : "1.113560"
225 "version" : "2.012"
205226 },
206227 {
207228 "class" : "Dist::Zilla::Plugin::Git::Tag",
208229 "name" : "@RJBS/@Git/Tag",
209 "version" : "1.113560"
230 "version" : "2.012"
210231 },
211232 {
212233 "class" : "Dist::Zilla::Plugin::Git::Push",
213234 "name" : "@RJBS/@Git/Push",
214 "version" : "1.113560"
235 "version" : "2.012"
215236 },
216237 {
217238 "class" : "Dist::Zilla::Plugin::FinderCode",
218239 "name" : ":InstallModules",
219 "version" : "4.300005"
240 "version" : "4.300033"
220241 },
221242 {
222243 "class" : "Dist::Zilla::Plugin::FinderCode",
223244 "name" : ":IncModules",
224 "version" : "4.300005"
245 "version" : "4.300033"
225246 },
226247 {
227248 "class" : "Dist::Zilla::Plugin::FinderCode",
228249 "name" : ":TestFiles",
229 "version" : "4.300005"
250 "version" : "4.300033"
230251 },
231252 {
232253 "class" : "Dist::Zilla::Plugin::FinderCode",
233254 "name" : ":ExecFiles",
234 "version" : "4.300005"
255 "version" : "4.300033"
235256 },
236257 {
237258 "class" : "Dist::Zilla::Plugin::FinderCode",
238259 "name" : ":ShareFiles",
239 "version" : "4.300005"
260 "version" : "4.300033"
240261 },
241262 {
242263 "class" : "Dist::Zilla::Plugin::FinderCode",
243264 "name" : ":MainModule",
244 "version" : "4.300005"
265 "version" : "4.300033"
245266 }
246267 ],
247268 "zilla" : {
249270 "config" : {
250271 "is_trial" : "0"
251272 },
252 "version" : "4.300005"
273 "version" : "4.300033"
253274 }
254275 }
255276 }
77 configure_requires:
88 ExtUtils::MakeMaker: 6.30
99 dynamic_config: 0
10 generated_by: 'Dist::Zilla version 4.300005, CPAN::Meta::Converter version 2.112621'
10 generated_by: 'Dist::Zilla version 4.300033, CPAN::Meta::Converter version 2.130880'
1111 license: perl
1212 meta-spec:
1313 url: http://module-build.sourceforge.net/META-spec-v1.4.html
1414 version: 1.4
1515 name: CPAN-Mini
1616 requires:
17 CPAN: 0
18 CPANPLUS::Backend: 0
1719 Carp: 0
1820 Compress::Zlib: 1.20
1921 File::Basename: 0
3335 resources:
3436 homepage: https://github.com/rjbs/cpan-mini
3537 repository: https://github.com/rjbs/cpan-mini.git
36 version: 1.111008
38 version: 1.111013
3739 x_Dist_Zilla:
40 perl:
41 version: 5.017010
3842 plugins:
43 -
44 class: Dist::Zilla::Plugin::Git::GatherDir
45 name: '@RJBS/Git::GatherDir'
46 version: 2.012
3947 -
4048 class: Dist::Zilla::Plugin::CheckPrereqsIndexed
4149 name: '@RJBS/CheckPrereqsIndexed'
42 version: 0.007
43 -
44 class: Dist::Zilla::Plugin::GatherDir
45 name: '@RJBS/@Basic/GatherDir'
46 version: 4.300005
50 version: 0.008
51 -
52 class: Dist::Zilla::Plugin::CheckExtraTests
53 name: '@RJBS/CheckExtraTests'
54 version: 0.011
4755 -
4856 class: Dist::Zilla::Plugin::PruneCruft
49 name: '@RJBS/@Basic/PruneCruft'
50 version: 4.300005
57 name: '@RJBS/@Filter/PruneCruft'
58 version: 4.300033
5159 -
5260 class: Dist::Zilla::Plugin::ManifestSkip
53 name: '@RJBS/@Basic/ManifestSkip'
54 version: 4.300005
61 name: '@RJBS/@Filter/ManifestSkip'
62 version: 4.300033
5563 -
5664 class: Dist::Zilla::Plugin::MetaYAML
57 name: '@RJBS/@Basic/MetaYAML'
58 version: 4.300005
65 name: '@RJBS/@Filter/MetaYAML'
66 version: 4.300033
5967 -
6068 class: Dist::Zilla::Plugin::License
61 name: '@RJBS/@Basic/License'
62 version: 4.300005
69 name: '@RJBS/@Filter/License'
70 version: 4.300033
6371 -
6472 class: Dist::Zilla::Plugin::Readme
65 name: '@RJBS/@Basic/Readme'
66 version: 4.300005
67 -
68 class: Dist::Zilla::Plugin::ExtraTests
69 name: '@RJBS/@Basic/ExtraTests'
70 version: 4.300005
73 name: '@RJBS/@Filter/Readme'
74 version: 4.300033
7175 -
7276 class: Dist::Zilla::Plugin::ExecDir
73 name: '@RJBS/@Basic/ExecDir'
74 version: 4.300005
77 name: '@RJBS/@Filter/ExecDir'
78 version: 4.300033
7579 -
7680 class: Dist::Zilla::Plugin::ShareDir
77 name: '@RJBS/@Basic/ShareDir'
78 version: 4.300005
81 name: '@RJBS/@Filter/ShareDir'
82 version: 4.300033
7983 -
8084 class: Dist::Zilla::Plugin::MakeMaker
81 name: '@RJBS/@Basic/MakeMaker'
82 version: 4.300005
85 name: '@RJBS/@Filter/MakeMaker'
86 version: 4.300033
8387 -
8488 class: Dist::Zilla::Plugin::Manifest
85 name: '@RJBS/@Basic/Manifest'
86 version: 4.300005
89 name: '@RJBS/@Filter/Manifest'
90 version: 4.300033
8791 -
8892 class: Dist::Zilla::Plugin::TestRelease
89 name: '@RJBS/@Basic/TestRelease'
90 version: 4.300005
93 name: '@RJBS/@Filter/TestRelease'
94 version: 4.300033
9195 -
9296 class: Dist::Zilla::Plugin::ConfirmRelease
93 name: '@RJBS/@Basic/ConfirmRelease'
94 version: 4.300005
97 name: '@RJBS/@Filter/ConfirmRelease'
98 version: 4.300033
9599 -
96100 class: Dist::Zilla::Plugin::UploadToCPAN
97 name: '@RJBS/@Basic/UploadToCPAN'
98 version: 4.300005
101 name: '@RJBS/@Filter/UploadToCPAN'
102 version: 4.300033
99103 -
100104 class: Dist::Zilla::Plugin::AutoPrereqs
101105 name: '@RJBS/AutoPrereqs'
102 version: 4.300005
106 version: 4.300033
103107 -
104108 class: Dist::Zilla::Plugin::Git::NextVersion
105109 name: '@RJBS/Git::NextVersion'
106 version: 1.113560
110 version: 2.012
107111 -
108112 class: Dist::Zilla::Plugin::PkgVersion
109113 name: '@RJBS/PkgVersion'
110 version: 4.300005
114 version: 4.300033
111115 -
112116 class: Dist::Zilla::Plugin::MetaConfig
113117 name: '@RJBS/MetaConfig'
114 version: 4.300005
118 version: 4.300033
115119 -
116120 class: Dist::Zilla::Plugin::MetaJSON
117121 name: '@RJBS/MetaJSON'
118 version: 4.300005
122 version: 4.300033
119123 -
120124 class: Dist::Zilla::Plugin::NextRelease
121125 name: '@RJBS/NextRelease'
122 version: 4.300005
126 version: 4.300033
127 -
128 class: Dist::Zilla::Plugin::Test::ChangesHasContent
129 name: '@RJBS/Test::ChangesHasContent'
130 version: 0.006
123131 -
124132 class: Dist::Zilla::Plugin::PodSyntaxTests
125133 name: '@RJBS/PodSyntaxTests'
126 version: 4.300005
127 -
128 class: Dist::Zilla::Plugin::Repository
129 name: '@RJBS/Repository'
130 version: 0.18
134 version: 4.300033
135 -
136 class: Dist::Zilla::Plugin::Test::Compile
137 name: '@RJBS/Test::Compile'
138 version: 2.001
139 -
140 class: Dist::Zilla::Plugin::ReportVersions::Tiny
141 name: '@RJBS/ReportVersions::Tiny'
142 version: 1.08
131143 -
132144 class: Dist::Zilla::Plugin::Prereqs
133145 config:
135147 phase: test
136148 type: requires
137149 name: '@RJBS/TestMoreWithSubtests'
138 version: 4.300005
150 version: 4.300033
139151 -
140152 class: Dist::Zilla::Plugin::PodWeaver
141153 name: '@RJBS/PodWeaver'
147159 -
148160 class: Dist::Zilla::Plugin::Git::Check
149161 name: '@RJBS/@Git/Check'
150 version: 1.113560
162 version: 2.012
151163 -
152164 class: Dist::Zilla::Plugin::Git::Commit
153165 name: '@RJBS/@Git/Commit'
154 version: 1.113560
166 version: 2.012
155167 -
156168 class: Dist::Zilla::Plugin::Git::Tag
157169 name: '@RJBS/@Git/Tag'
158 version: 1.113560
170 version: 2.012
159171 -
160172 class: Dist::Zilla::Plugin::Git::Push
161173 name: '@RJBS/@Git/Push'
162 version: 1.113560
174 version: 2.012
163175 -
164176 class: Dist::Zilla::Plugin::FinderCode
165177 name: ':InstallModules'
166 version: 4.300005
178 version: 4.300033
167179 -
168180 class: Dist::Zilla::Plugin::FinderCode
169181 name: ':IncModules'
170 version: 4.300005
182 version: 4.300033
171183 -
172184 class: Dist::Zilla::Plugin::FinderCode
173185 name: ':TestFiles'
174 version: 4.300005
186 version: 4.300033
175187 -
176188 class: Dist::Zilla::Plugin::FinderCode
177189 name: ':ExecFiles'
178 version: 4.300005
190 version: 4.300033
179191 -
180192 class: Dist::Zilla::Plugin::FinderCode
181193 name: ':ShareFiles'
182 version: 4.300005
194 version: 4.300033
183195 -
184196 class: Dist::Zilla::Plugin::FinderCode
185197 name: ':MainModule'
186 version: 4.300005
198 version: 4.300033
187199 zilla:
188200 class: Dist::Zilla::Dist::Builder
189201 config:
190202 is_trial: 0
191 version: 4.300005
203 version: 4.300033
1010 my %WriteMakefileArgs = (
1111 "ABSTRACT" => "create a minimal mirror of CPAN",
1212 "AUTHOR" => "Ricardo SIGNES <rjbs\@cpan.org>, Randal Schwartz <merlyn\@stonehenge.com>",
13 "BUILD_REQUIRES" => {
14 "Test::More" => "0.96"
15 },
13 "BUILD_REQUIRES" => {},
1614 "CONFIGURE_REQUIRES" => {
1715 "ExtUtils::MakeMaker" => "6.30"
1816 },
2321 "LICENSE" => "perl",
2422 "NAME" => "CPAN::Mini",
2523 "PREREQ_PM" => {
24 "CPAN" => 0,
25 "CPANPLUS::Backend" => 0,
2626 "Carp" => 0,
2727 "Compress::Zlib" => "1.20",
2828 "File::Basename" => 0,
3939 "strict" => 0,
4040 "warnings" => 0
4141 },
42 "VERSION" => "1.111008",
42 "TEST_REQUIRES" => {
43 "Test::More" => "0.96"
44 },
45 "VERSION" => "1.111013",
4346 "test" => {
4447 "TESTS" => "t/*.t"
4548 }
4649 );
4750
51
52 unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
53 my $tr = delete $WriteMakefileArgs{TEST_REQUIRES};
54 my $br = $WriteMakefileArgs{BUILD_REQUIRES};
55 for my $mod ( keys %$tr ) {
56 if ( exists $br->{$mod} ) {
57 $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod};
58 }
59 else {
60 $br->{$mod} = $tr->{$mod};
61 }
62 }
63 }
4864
4965 unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
5066 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
00
11
22 This archive contains the distribution CPAN-Mini,
3 version 1.111008:
3 version 1.111013:
44
55 create a minimal mirror of CPAN
66
66 # PODNAME: minicpan
77 # ABSTRACT: uses CPAN::Mini to create or update a local mirror
88
9
9 __END__
1010
1111 =pod
1212
1616
1717 =head1 VERSION
1818
19 version 1.111008
19 version 1.111013
2020
2121 =head1 SYNOPSIS
2222
3939 -t SEC - timeout in sec. Defaults to 180 sec
4040 --offline - operate in offline mode (generally: do nothing)
4141 --log-level - provide a log level; instead of --debug, -q, or -qq
42 --remote-from TYPE - cpan remote from 'cpan' or 'cpanplus' configs
4243
4344 =head1 DESCRIPTION
4445
108109 the same terms as the Perl 5 programming language system itself.
109110
110111 =cut
111
112
113 __END__
114
22
33 package CPAN::Mini::App;
44 {
5 $CPAN::Mini::App::VERSION = '1.111008';
5 $CPAN::Mini::App::VERSION = '1.111013';
66 }
77
88 # ABSTRACT: the guts of the minicpan command
4545
4646 my %commandline;
4747
48 my ($quiet, $debug, $log_level);
48 my @option_spec = $class->_option_spec();
49 GetOptions(\%commandline, @option_spec) or pod2usage(2);
4950
50 GetOptions(
51 'c|class=s' => \$commandline{class},
51 # These two options will cause the program to exit before finishing ->run
52 pod2usage(1) if $commandline{help};
53 $version = 1 if $commandline{version};
5254
53 # These two options will cause the program to exit before finishing ->run
54 'h|help' => sub { pod2usage(1); },
55 'v|version' => sub { $version = 1 },
56
57 # How noisy should we be?
58 'quiet|q+' => \$quiet,
59 'qq' => sub { $quiet = 2 },
60 'debug' => \$debug,
61 'log-level=s' => \$log_level,
62
63 'l|local=s' => \$commandline{local},
64 'r|remote=s' => \$commandline{remote},
65
66 'd|dirmode=s' => \$commandline{dirmode},
67 'offline' => \$commandline{offline},
68 'f' => \$commandline{force},
69 'p' => \$commandline{perl},
70 'x' => \$commandline{exact_mirror},
71 't|timeout=i' => \$commandline{timeout},
72
73 # Where to look for config not provided on the command line:
74 'C|config=s' => \$commandline{config_file},
75 ) or pod2usage(2);
55 # How noisy should we be?
56 my $debug = $commandline{debug};
57 my $log_level = $commandline{log_level};
58 my $quiet = $commandline{qq} ? 2 : $commandline{quiet};
7659
7760 die "can't mix --debug, --log-level, and --debug\n"
7861 if defined($quiet) + defined($debug) + defined($log_level) > 1;
7962
63 # Set log_level accordingly
8064 $quiet ||= 0;
8165 $log_level = $debug ? 'debug'
8266 : $quiet == 1 ? 'warn'
8367 : $quiet >= 2 ? 'fatal'
8468 : $log_level ? $log_level
8569 : undef;
86
87 $class->_validate_log_level($log_level) if defined $log_level;
8870
8971 my %config = CPAN::Mini->read_config({
9072 log_level => 'info',
9375
9476 $config{class} ||= 'CPAN::Mini';
9577
96 foreach my $key (keys %commandline) {
97 $config{$key} = $commandline{$key} if defined $commandline{$key};
98 }
78 # Override config with commandline options
79 %config = (%config, %commandline);
9980
10081 $config{log_level} = $log_level || $config{log_level} || 'info';
101
10282 $class->_validate_log_level($config{log_level});
10383
10484 eval "require $config{class}";
10585 die $@ if $@;
10686
10787 _display_version($config{class}) if $version;
88
89 if ($config{remote_from} && ! $config{remote}) {
90 $config{remote} = $config{class}->remote_from(
91 $config{remote_from},
92 $config{remote},
93 $config{quiet},
94 );
95 }
96
97 $config{remote} ||= 'http://www.cpan.org/';
98
10899 pod2usage(2) unless $config{local} and $config{remote};
109100
110101 $|++;
111 $config{dirmode} &&= oct($config{dirmode});
112102
113 return $config{class}->new(
114 remote => $config{remote},
115 local => $config{local},
116 force => $config{force},
117 offline => $config{offline},
118 also_mirror => $config{also_mirror},
119 exact_mirror => $config{exact_mirror},
120 module_filters => $config{module_filters},
121 path_filters => $config{path_filters},
122 skip_cleanup => $config{skip_cleanup},
123 skip_perl => (not $config{perl}),
124 timeout => $config{timeout},
125 ignore_source_control => $config{ignore_source_control},
126 (defined $config{dirmode} ? (dirmode => $config{dirmode}) : ()),
103 # Convert dirmode string to a real octal value, if given
104 $config{dirmode} = oct $config{dirmode} if $config{dirmode};
127105
128 log_level => $config{log_level},
129 );
106 # Turn the 'perl' option into 'skip_perl', for backward compatibility
107 $config{skip_perl} = not delete $config{perl};
108
109 return $config{class}->new(%config);
110 }
111
112 sub _option_spec {
113 return qw<
114 class|c=s
115 help|h
116 version|v
117 quiet|q+
118 qq
119 debug
120 log_level|log-level=s
121 local|l=s
122 remote|r=s
123 dirmode|d=s
124 offline
125 force|f
126 perl
127 exact_mirror|x
128 timeout|t=i
129 config_file|config|C=s
130 remote-from=s
131 >;
130132 }
131133
132134
133135 1;
134136
135137 __END__
138
136139 =pod
137140
138141 =head1 NAME
141144
142145 =head1 VERSION
143146
144 version 1.111008
147 version 1.111013
145148
146149 =head1 SYNOPSIS
147150
156159 This method is called by F<minicpan> to do all the work. Don't rely on what it
157160 does just yet.
158161
159 =head1 SEE ALSO
162 =head1 SEE ALSO
160163
161164 Randal Schwartz's original article, which can be found here:
162165
184187 the same terms as the Perl 5 programming language system itself.
185188
186189 =cut
187
33
44 package CPAN::Mini;
55 {
6 $CPAN::Mini::VERSION = '1.111008';
6 $CPAN::Mini::VERSION = '1.111013';
77 }
88
99 # ABSTRACT: create a minimal mirror of CPAN
3232 $self = $self->new(@_) unless ref $self;
3333
3434 unless ($self->{offline}) {
35 $self->log("Updating $self->{local}");
35 my $local = $self->{local};
36
37 $self->log("Updating $local");
3638 $self->log("Mirroring from $self->{remote}");
3739 $self->log("=" x 63);
40
41 die "local mirror target $local is not writable" unless -w $local;
3842
3943 # mirrored tracks the already done, keyed by filename
4044 # 1 = local-checked, 2 = remote-mirrored
9195 or die "Cannot open details: $Compress::Zlib::gzerrno";
9296
9397 my $inheader = 1;
98 my $file_ok = 0;
9499 while ($gz->gzreadline($_) > 0) {
95100 if ($inheader) {
96 $inheader = 0 unless /\S/;
101 if (/\S/) {
102 my ($header, $value) = split /:\s*/, $_, 2;
103 chomp $value;
104 $file_ok = 1 if $header eq 'File'
105 and $value eq '02packages.details.txt';
106 } else {
107 $inheader = 0;
108 }
109
97110 next;
98111 }
112
113 die "02packages.details.txt file is not a valid index\n"
114 unless $file_ok;
99115
100116 my ($module, $version, $path) = split;
101117 next if $self->_filter_module({
329345 for (@$filter) {
330346 return 1 if $self->__do_filter($_, $file);
331347 }
348 return;
332349 }
333350
334351 if (ref($filter) eq 'CODE') {
433450 $_[0]->log_unconditionally($_[1], $_[2]);
434451 }
435452
436 sub trace { my $self = shift; $self->log_info(@_); }
453 sub trace {
454 my $self = shift;
455 $self->log(@_);
456 }
437457
438458 sub log_debug {
439459 my ($self, @rest) = @_;
477497 $class->log("Using config from $config_file")
478498 if ($options->{log_level}||'info') =~ /\A(?:warn|fatal)\z/;
479499
500 substr($config_file, 0, 1, $class->__homedir)
501 if substr($config_file, 0, 1) eq q{~};
502
480503 return unless -e $config_file;
481504
482505 open my $config_fh, '<', $config_file
483506 or die "couldn't open config file $config_file: $!";
484507
485508 my %config;
509 my %is_multivalue = map {; $_ => 1 }
510 qw(also_mirror module_filters path_filters);
511
512 $config{$_} = [] for keys %is_multivalue;
513
486514 while (<$config_fh>) {
487515 chomp;
488516 next if /\A\s*\Z/sm;
489 if (/\A(\w+):\s*(\S.*?)\s*\Z/sm) { $config{$1} = $2; }
517
518 if (/\A(\w+):\s*(\S.*?)\s*\Z/sm) {
519 my ($key, $value) = ($1, $2);
520
521 if ($is_multivalue{ $key }) {
522 push @{ $config{$key} }, split /\s+/, $value;
523 } else {
524 $config{ $key } = $value;
525 }
526 }
490527 }
491528
492529 for (qw(also_mirror)) {
493 $config{$_} = [ grep { length } split /\s+/, $config{$_} ] if $config{$_};
530 $config{$_} = [ grep { length } @{ $config{$_} } ];
494531 }
495532
496533 for (qw(module_filters path_filters)) {
497 $config{$_} = [ map { qr/$_/ } split /\s+/, $config{$_} ] if $config{$_};
534 $config{$_} = [ map { qr/$_/ } @{ $config{$_} } ];
535 }
536
537 for (keys %is_multivalue) {
538 delete $config{$_} unless @{ $config{$_} };
498539 }
499540
500541 return %config;
526567 }
527568
528569
570 sub remote_from {
571 my ( $class, $remote_from, $orig_remote, $quiet ) = @_;
572
573 my $method = lc "remote_from_" . $remote_from;
574
575 Carp::croak "unknown remote_from value: $remote_from"
576 unless $class->can($method);
577
578 my $new_remote = $class->$method;
579
580 warn "overriding '$orig_remote' with '$new_remote' via $method\n"
581 if !$quiet && $orig_remote;
582
583 return $new_remote;
584 }
585
586
587 sub remote_from_cpan {
588 my ($self) = @_;
589
590 Carp::croak "unable find a CPAN, maybe you need to install it"
591 unless eval { require CPAN; 1 };
592
593 CPAN::HandleConfig::require_myconfig_or_config();
594
595 Carp::croak "unable to find mirror list in your CPAN config"
596 unless exists $CPAN::Config->{urllist};
597
598 Carp::croak "unable to find first mirror url in your CPAN config"
599 unless ref( $CPAN::Config->{urllist} ) eq 'ARRAY' && $CPAN::Config->{urllist}[0];
600
601 return $CPAN::Config->{urllist}[0];
602 }
603
604
605 sub remote_from_cpanplus {
606 my ($self) = @_;
607
608 Carp::croak "unable find a CPANPLUS, maybe you need to install it"
609 unless eval { require CPANPLUS::Backend };
610
611 my $cb = CPANPLUS::Backend->new;
612 my $hosts = $cb->configure_object->get_conf('hosts');
613
614 Carp::croak "unable to find mirror list in your CPANPLUS config"
615 unless $hosts;
616
617 Carp::croak "unable to find first mirror in your CPANPLUS config"
618 unless ref($hosts) eq 'ARRAY' && $hosts->[0];
619
620 my $url_parts = $hosts->[0];
621 return $url_parts->{scheme} . "://" . $url_parts->{host} . ( $url_parts->{path} || '' );
622 }
623
624
529625 1;
530626
531627 __END__
628
532629 =pod
533630
534631 =head1 NAME
537634
538635 =head1 VERSION
539636
540 version 1.111008
637 version 1.111013
541638
542639 =head1 SYNOPSIS
543640
590687 );
591688
592689 This is the only method that need be called from outside this module. It will
593 update the local mirror with the files from the remote mirror.
690 update the local mirror with the files from the remote mirror.
594691
595692 If called as a class method, C<update_mirror> creates an ephemeral CPAN::Mini
596693 object on which other methods are called. That object is used to store mirror
601698 The following options are recognized:
602699
603700 =over 4
701
702 =item *
703
704 C<local>
705
706 This is the local file path where the mirror will be written or updated.
707
708 =item *
709
710 C<remote>
711
712 This is the URL of the CPAN mirror from which to work. A reasonable default
713 will be picked by default. A list of CPAN mirrors can be found at
714 L<http://www.cpan.org/SITES.html>
604715
605716 =item *
606717
741852
742853 This method looks through the local mirror's files. If it finds a file that
743854 neither belongs in the mirror nor is allowed (see the C<file_allowed> method),
744 C<clean_file> is called on the file.
855 C<clean_file> is called on the file.
745856
746857 If you set C<ignore_source_control> to a true value, then this doesn't clean
747858 up files that belong to source control systems. Currently this ignores:
783894
784895 =head2 config_file
785896
786 my %config = CPAN::Mini->config_file( { options } );
897 my $config_file = CPAN::Mini->config_file( { options } );
787898
788899 This routine returns the config file name. It first looks at for the
789900 C<config_file> setting, then the C<CPAN_MINI_CONFIG> environment
790901 variable, then the default F<~/.minicpanrc>, and finally the
791902 F<CPAN/Mini/minicpan.conf>. It uses the first defined value it finds.
792 If the filename it selects does not exist, it returns the empty list.
793
794 OPTIONS is an optional hash reference of the C<CPAN::Mini> config hash.
903 If the filename it selects does not exist, it returns false.
904
905 OPTIONS is an optional hash reference of the C<CPAN::Mini> config hash.
795906
796907 =begin devel
797908
809920
810921 =end devel
811922
923 =head2 remote_from
924
925 my $remote = CPAN::Mini->remote_from( $remote_from, $orig_remote, $quiet );
926
927 This routine take an string argument and turn it into a method
928 call to handle to retrieve the a cpan mirror url from a source.
929 Currently supported methods:
930
931 cpan - fetch the first mirror from your CPAN.pm config
932 cpanplus - fetch the first mirror from your CPANPLUS.pm config
933
934 =head2 remote_from_cpan
935
936 my $remote = CPAN::Mini->remote_from_cpan;
937
938 This routine loads your CPAN.pm config and returns the first mirror in mirror
939 list. You can set this as your default by setting remote_from:cpan in your
940 F<.minicpanrc> file.
941
942 =head2 remote_from_cpanplus
943
944 my $remote = CPAN::Mini->remote_from_cpanplus;
945
946 This routine loads your CPANPLUS.pm config and returns the first mirror in
947 mirror list. You can set this as your default by setting remote_from:cpanplus
948 in your F<.minicpanrc> file.
949
812950 =head1 SEE ALSO
813951
814952 Randal Schwartz's original article on minicpan, here:
859997 the same terms as the Perl 5 programming language system itself.
860998
861999 =cut
862
0 #!perl
1
2 use strict;
3 use warnings;
4
5 use Test::More;
6
7
8
9 use File::Find;
10 use File::Temp qw{ tempdir };
11
12 my @modules;
13 find(
14 sub {
15 return if $File::Find::name !~ /\.pm\z/;
16 my $found = $File::Find::name;
17 $found =~ s{^lib/}{};
18 $found =~ s{[/\\]}{::}g;
19 $found =~ s/\.pm$//;
20 # nothing to skip
21 push @modules, $found;
22 },
23 'lib',
24 );
25
26 sub _find_scripts {
27 my $dir = shift @_;
28
29 my @found_scripts = ();
30 find(
31 sub {
32 return unless -f;
33 my $found = $File::Find::name;
34 # nothing to skip
35 open my $FH, '<', $_ or do {
36 note( "Unable to open $found in ( $! ), skipping" );
37 return;
38 };
39 my $shebang = <$FH>;
40 return unless $shebang =~ /^#!.*?\bperl\b\s*$/;
41 push @found_scripts, $found;
42 },
43 $dir,
44 );
45
46 return @found_scripts;
47 }
48
49 my @scripts;
50 do { push @scripts, _find_scripts($_) if -d $_ }
51 for qw{ bin script scripts };
52
53 my $plan = scalar(@modules) + scalar(@scripts);
54 $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
55
56 {
57 # fake home for cpan-testers
58 # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 );
59
60 like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
61 for sort @modules;
62
63 SKIP: {
64 eval "use Test::Script 1.05; 1;";
65 skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
66 foreach my $file ( @scripts ) {
67 my $script = $file;
68 $script =~ s!.*/!!;
69 script_compiles( $file, "$script script compiles" );
70 }
71 }
72
73 }
0 #!perl -T
0 #!perl
11
22 use Test::More tests => 1;
33
0 use strict;
1 use warnings;
2 use Test::More 0.88;
3 # This is a relatively nice way to avoid Test::NoWarnings breaking our
4 # expectations by adding extra tests, without using no_plan. It also helps
5 # avoid any other test module that feels introducing random tests, or even
6 # test plans, is a nice idea.
7 our $success = 0;
8 END { $success && done_testing; }
9
10 # List our own version used to generate this
11 my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.08\n";
12
13 eval { # no excuses!
14 # report our Perl details
15 my $want = '5.006';
16 $v .= "perl: $] (wanted $want) on $^O from $^X\n\n";
17 };
18 defined($@) and diag("$@");
19
20 # Now, our module version dependencies:
21 sub pmver {
22 my ($module, $wanted) = @_;
23 $wanted = " (want $wanted)";
24 my $pmver;
25 eval "require $module;";
26 if ($@) {
27 if ($@ =~ m/Can't locate .* in \@INC/) {
28 $pmver = 'module not found.';
29 } else {
30 diag("${module}: $@");
31 $pmver = 'died during require.';
32 }
33 } else {
34 my $version;
35 eval { $version = $module->VERSION; };
36 if ($@) {
37 diag("${module}: $@");
38 $pmver = 'died during VERSION check.';
39 } elsif (defined $version) {
40 $pmver = "$version";
41 } else {
42 $pmver = '<undef>';
43 }
44 }
45
46 # So, we should be good, right?
47 return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n");
48 }
49
50 eval { $v .= pmver('CPAN','any version') };
51 eval { $v .= pmver('CPANPLUS::Backend','any version') };
52 eval { $v .= pmver('Carp','any version') };
53 eval { $v .= pmver('Compress::Zlib','1.20') };
54 eval { $v .= pmver('ExtUtils::MakeMaker','6.30') };
55 eval { $v .= pmver('File::Basename','any version') };
56 eval { $v .= pmver('File::Copy','any version') };
57 eval { $v .= pmver('File::Find','any version') };
58 eval { $v .= pmver('File::HomeDir','0.57') };
59 eval { $v .= pmver('File::Path','2.04') };
60 eval { $v .= pmver('File::Spec','any version') };
61 eval { $v .= pmver('File::Temp','any version') };
62 eval { $v .= pmver('Getopt::Long','any version') };
63 eval { $v .= pmver('LWP::UserAgent','5') };
64 eval { $v .= pmver('Pod::Usage','1.00') };
65 eval { $v .= pmver('Test::More','0.96') };
66 eval { $v .= pmver('Test::Pod','1.41') };
67 eval { $v .= pmver('URI','1') };
68 eval { $v .= pmver('strict','any version') };
69 eval { $v .= pmver('version','0.9901') };
70 eval { $v .= pmver('warnings','any version') };
71
72
73 # All done.
74 $v .= <<'EOT';
75
76 Thanks for using my code. I hope it works for you.
77 If not, please try and include this output in the bug report.
78 That will help me reproduce the issue and solve your problem.
79
80 EOT
81
82 diag($v);
83 ok(1, "we really didn't test anything, just reporting data");
84 $success = 1;
85
86 # Work around another nasty module on CPAN. :/
87 no warnings 'once';
88 $Template::Test::NO_FLUSH = 1;
89 exit 0;
1010
1111 delete $ENV{CPAN_MINI_CONFIG};
1212
13 {
14 no warnings 'redefine';
15 *File::HomeDir::my_home = sub { $ENV{HOME} };
16 }
17
1318 sub config_dir {
1419 my ($config) = @_;
1520
1621 my $tempdir = tempdir(CLEANUP => 1);
1722
18 return unless defined $config;
23 return $tempdir unless defined $config;
1924
2025 my $filename = File::Spec->catfile($tempdir, '.minicpanrc');
2126 open my $config_fh, '>', $filename or die "can't write to $filename: $!";
104109 };
105110 }
106111
112
113 subtest "-perl switch" => sub {
114
115 local $ENV{HOME} = config_dir;
116 local @ARGV = @LR_ARGS;
117
118 my $minicpan = CPAN::Mini::App->initialize_minicpan;
119 isa_ok($minicpan, 'CPAN::Mini');
120 is($minicpan->{skip_perl}, 1, "'skip_perl' is true without -perl switch");
121
122
123 local @ARGV = ('-perl', @LR_ARGS);
124 $minicpan = CPAN::Mini::App->initialize_minicpan;
125 isa_ok($minicpan, 'CPAN::Mini');
126 is($minicpan->{skip_perl}, q{}, "'skip_perl' is false with -perl switch");
127 };
128
107129 done_testing;
108130
109131 1;
+0
-15
t/release-pod-syntax.t less more
0 #!perl
1
2 BEGIN {
3 unless ($ENV{RELEASE_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for release candidate testing');
6 }
7 }
8
9 use Test::More;
10
11 eval "use Test::Pod 1.41";
12 plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
13
14 all_pod_files_ok();
0 #!perl
1
2 use Test::More tests => 2;
3
4 note 'Checking Changes';
5 my $changes_file = 'Changes';
6 my $newver = '1.111013';
7 my $trial_token = '-TRIAL';
8
9 SKIP: {
10 ok(-e $changes_file, "$changes_file file exists")
11 or skip 'Changes is missing', 1;
12
13 ok(_get_changes($newver), "$changes_file has content for $newver");
14 }
15
16 done_testing;
17
18 # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit
19 # by Jerome Quelin
20 sub _get_changes
21 {
22 my $newver = shift;
23
24 # parse changelog to find commit message
25 open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!";
26 my $changelog = join('', <$fh>);
27 close $fh;
28
29 my @content =
30 grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented
31 split /\n/, $changelog;
32 shift @content; # drop the version line
33
34 # drop unindented last line and trailing blank lines
35 pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ );
36
37 # return number of non-blank lines
38 return scalar @content;
39 }
40
0 #!perl
1 use Test::More;
2
3 eval "use Test::Pod 1.41";
4 plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
5
6 all_pod_files_ok();