Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update docs, eliminate some more trace

  • Loading branch information...
commit 91273805419ac71b63fa429c441eae4d31b47cef 1 parent ebc4a81
@rjbs authored
Showing with 34 additions and 29 deletions.
  1. +16 −15 bin/minicpan
  2. +16 −12 lib/CPAN/Mini.pm
  3. +2 −2 xt/fake.t
View
31 bin/minicpan
@@ -14,21 +14,22 @@ __END__
minicpan [options]
Options
- -l LOCAL - where is the local minicpan? (required)
- -r REMOTE - where is the remote cpan mirror? (required)
- -d 0### - permissions (numeric) to use when creating directories
- -f - check all directories, even if indices are unchanged
- -p - mirror perl, ponie, and parrot distributions
- --debug - run in debug mode (print even banal messages)
- -q - run in quiet mode (don't print status)
- -qq - run in silent mode (don't even print warnings)
- -c CLASS - what class to use to mirror (default: CPAN::Mini)
- -C FILE - what config file to use (default: ~/.minicpanrc)
- -h - print help and exit
- -v - print version and exit
- -x - build an exact mirror, getting even normally disallowed files
- -t SEC - timeout in sec. Defaults to 180 sec
- --offline - operate in offline mode (generally: do nothing)
+ -l LOCAL - where is the local minicpan? (required)
+ -r REMOTE - where is the remote cpan mirror? (required)
+ -d 0### - permissions (numeric) to use when creating directories
+ -f - check all directories, even if indices are unchanged
+ -p - mirror perl, ponie, and parrot distributions
+ --debug - run in debug mode (print even banal messages)
+ -q - run in quiet mode (don't print status)
+ -qq - run in silent mode (don't even print warnings)
+ -c CLASS - what class to use to mirror (default: CPAN::Mini)
+ -C FILE - what config file to use (default: ~/.minicpanrc)
+ -h - print help and exit
+ -v - print version and exit
+ -x - build an exact mirror, getting even normally disallowed files
+ -t SEC - timeout in sec. Defaults to 180 sec
+ --offline - operate in offline mode (generally: do nothing)
+ --log-level - provide a log level; instead of --debug, -q, or -qq
=head1 DESCRIPTION
View
28 lib/CPAN/Mini.pm
@@ -18,7 +18,7 @@ L<minicpan> command, instead.)
CPAN::Mini->update_mirror(
remote => "http://cpan.mirrors.comintern.su",
local => "/usr/share/mirrors/cpan",
- trace => 1
+ log_level => 'debug',
);
=head1 DESCRIPTION
@@ -52,12 +52,12 @@ use Compress::Zlib 1.20 ();
=method update_mirror
- CPAN::Mini->update_mirror(
- remote => "http://cpan.mirrors.comintern.su",
- local => "/usr/share/mirrors/cpan",
- force => 0,
- trace => 1
- );
+ CPAN::Mini->update_mirror(
+ remote => "http://cpan.mirrors.comintern.su",
+ local => "/usr/share/mirrors/cpan",
+ force => 0,
+ log_level => 'debug',
+ );
This is the only method that need be called from outside this module. It will
update the local mirror with the files from the remote mirror.
@@ -97,9 +97,9 @@ on this run.
If true, CPAN::Mini will skip the major language distributions: perl, parrot,
and ponie. It will also skip embperl, sybperl, bioperl, and kurila.
-* C<trace>
+* C<log_level>
-If true, CPAN::Mini will print status messages to STDOUT as it works.
+This defines the minimum level of message to log: debug, info, warn, or fatal
* C<errors>
@@ -271,7 +271,7 @@ sub new {
File::Path::mkpath(
$self->{local},
{
- verbose => $self->{trace},
+ verbose => $self->{log_level} eq 'debug',
mode => $self->{dirmode},
},
);
@@ -378,7 +378,11 @@ sub _make_index_dirs {
sub _install_indices {
my $self = shift;
- $self->_make_index_dirs($self->{local}, $self->{dirmode}, $self->{trace});
+ $self->_make_index_dirs(
+ $self->{local},
+ $self->{dirmode},
+ $self->{log_level} eq 'debug',
+ );
for my $file ($self->_fixed_mirrors) {
my $local_file = File::Spec->catfile($self->{local}, split m{/}, $file);
@@ -431,7 +435,7 @@ sub mirror_file {
File::Path::mkpath(
File::Basename::dirname($local_file),
{
- verbose => $self->{trace},
+ verbose => $self->{log_level} eq 'debug',
mode => $self->{dirmode},
},
);
View
4 xt/fake.t
@@ -14,7 +14,7 @@ my $tempdir = tempdir(CLEANUP => 1);
CPAN::Mini->update_mirror(
remote => "http://fakecpan.org/fake/minicpan/1.001/cpan",
local => $tempdir,
- trace => 1,
+ log_level => 'fatal',
);
pass("performed initial mirror");
@@ -22,7 +22,7 @@ pass("performed initial mirror");
CPAN::Mini->update_mirror(
remote => "http://fakecpan.org/fake/minicpan/1.002/cpan",
local => $tempdir,
- trace => 0,
+ log_level => 'fatal',
);
pass("performed mirror update");
Please sign in to comment.
Something went wrong with that request. Please try again.