Skip to content

Commit

Permalink
dzilify, round 1
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbs committed Feb 16, 2010
1 parent c597309 commit 9416d1c
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 528 deletions.
377 changes: 0 additions & 377 deletions LICENSE

This file was deleted.

11 changes: 0 additions & 11 deletions MANIFEST.SKIP

This file was deleted.

26 changes: 0 additions & 26 deletions Makefile.PL

This file was deleted.

10 changes: 0 additions & 10 deletions README

This file was deleted.

1 change: 0 additions & 1 deletion bin/minicpan
@@ -1,5 +1,4 @@
#!/usr/bin/perl -w

use strict;
use warnings;
use CPAN::Mini::App;
Expand Down
8 changes: 8 additions & 0 deletions dist.ini
@@ -0,0 +1,8 @@
name = CPAN-Mini
author = Ricardo SIGNES <rjbs@cpan.org>
author = Randal Schwartz <merlyn@stonehenge.com>
license = Perl_5
copyright_holder = Ricardo SIGNES

[@RJBS]
version = 1
100 changes: 35 additions & 65 deletions lib/CPAN/Mini.pm
@@ -1,20 +1,11 @@
use 5.006;
use strict;
use warnings;

package CPAN::Mini;
our $VERSION = '0.576';
# ABSTRACT: create a minimal mirror of CPAN

## no critic RequireCarping

=head1 NAME
CPAN::Mini - create a minimal mirror of CPAN
=head1 VERSION
version 0.576
=head1 SYNOPSIS
(If you're not going to do something weird, you probably want to look at the
Expand All @@ -34,38 +25,30 @@ CPAN::Mini provides a simple mechanism to build and update a minimal mirror of
the CPAN on your local disk. It contains only those files needed to install
the newest version of every distribution. Those files are:
=over 4
=item * 01mailrc.txt.gz
=item * 02packages.details.txt.gz
=item * 03modlist.data.gz
=item * the last non-developer release of every dist for every author
=back
=for :list
* 01mailrc.txt.gz
* 02packages.details.txt.gz
* 03modlist.data.gz
* the last non-developer release of every dist for every author
=cut

use Carp ();

use File::Basename ();
use File::Copy ();
use File::HomeDir ();
use File::HomeDir 0.57 (); # Win32 support
use File::Find ();
use File::Path 2.04 ();
use File::Path 2.04 (); # new API, bugfixes
use File::Spec ();
use File::Temp ();

use URI ();
use LWP::UserAgent ();
use URI 1 ();
use LWP::UserAgent 5 ();

use Compress::Zlib ();
use Compress::Zlib 1.20 ();

=head1 METHODS
=head2 update_mirror
=method update_mirror
CPAN::Mini->update_mirror(
remote => "http://cpan.mirrors.comintern.su",
Expand All @@ -85,37 +68,37 @@ This method returns the number of files updated.
The following options are recognized:
=over 4
=begin :list
=item * C<dirmode>
* C<dirmode>
Generally an octal number, this option sets the permissions of created
directories. It defaults to 0711.
=item * C<exact_mirror>
* C<exact_mirror>
If true, the C<files_allowed> method will allow all extra files to be mirrored.
=item * C<force>
* C<force>
If true, this option will cause CPAN::Mini to read the entire module list and
update anything out of date, even if the module list itself wasn't out of date
on this run.
=item * C<skip_perl>
* C<skip_perl>
If true, CPAN::Mini will skip the major language distributions: perl, parrot,
and ponie.
=item * C<trace>
* C<trace>
If true, CPAN::Mini will print status messages to STDOUT as it works.
=item * C<errors>
* C<errors>
If true, CPAN::Mini will warn with status messages on errors. (default: true)
=item * C<path_filters>
* C<path_filters>
This options provides a set of rules for filtering paths. If a distribution
matches one of the rules in C<path_filters>, it will not be mirrored. A regex
Expand All @@ -128,7 +111,7 @@ setting would skip all distributions from RJBS and SUNGO:
sub { $_[0] =~ /SUNGO/ }
]
=item * C<module_filters>
* C<module_filters>
This option provides a set of rules for filtering modules. It behaves like
path_filters, but acts only on module names. (Since most modules are in
Expand All @@ -138,26 +121,26 @@ distribution containing only modules with the word "Acme" in them:
module_filters => [ qr/Acme/i ]
=item * C<also_mirror>
* C<also_mirror>
This option should be an arrayref of extra files in the remote CPAN to mirror
locally.
=item * C<skip_cleanup>
* C<skip_cleanup>
If this option is true, CPAN::Mini will not try delete unmirrored files when it
has finished mirroring
=item * C<offline>
* C<offline>
If offline, CPAN::Mini will not attempt to contact remote resources.
=item * C<no_conn_cache>
* C<no_conn_cache>
If true, no connection cache will be established. This is mostly useful as a
workaround for connection cache failures.
=back
=end :list
=cut

Expand Down Expand Up @@ -238,7 +221,7 @@ sub _get_mirror_list {
return [ sort keys %mirror_list ];
}

=head2 new
=method new
my $minicpan = CPAN::Mini->new;
Expand Down Expand Up @@ -304,7 +287,7 @@ sub new {

sub __lwp { $_[0]->{__lwp} }

=head2 mirror_indices
=method mirror_indices
$minicpan->mirror_indices;
Expand Down Expand Up @@ -378,7 +361,7 @@ sub _install_indices {
}
}

=head2 mirror_file
=method mirror_file
$minicpan->mirror_file($path, $skip_if_present)
Expand Down Expand Up @@ -451,7 +434,7 @@ sub mirror_file {

=begin devel
=head2 _filter_module
=method _filter_module
next
if $self->_filter_module({ module => $foo, version => $foo, path => $foo });
Expand Down Expand Up @@ -499,7 +482,7 @@ sub _filter_module {
return 0;
}

=head2 file_allowed
=method file_allowed
next unless $minicpan->file_allowed($filename);
Expand All @@ -521,7 +504,7 @@ sub file_allowed {
return (substr(File::Basename::basename($file), 0, 1) eq q{.}) ? 1 : 0;
}

=head2 clean_unmirrored
=method clean_unmirrored
$minicpan->clean_unmirrored;
Expand All @@ -547,7 +530,7 @@ sub clean_unmirrored {
}, $self->{local};
}

=head2 clean_file
=method clean_file
$minicpan->clean_file($filename);
Expand All @@ -567,7 +550,7 @@ sub clean_file {
return 1;
}

=head2 trace
=method trace
$minicpan->trace($message);
Expand All @@ -581,7 +564,7 @@ sub trace {
print $message if $self->{trace};
}

=head2 read_config
=method read_config
my %config = CPAN::Mini->read_config;
Expand Down Expand Up @@ -639,8 +622,6 @@ sub read_config {
return %config;
}

=head2
=head1 SEE ALSO
Randal Schwartz's original article on minicpan, here:
Expand Down Expand Up @@ -669,17 +650,6 @@ documentation.
Thanks to David Golden for some important bugfixes and refactoring.
=head1 AUTHORS
Randal Schwartz <F<merlyn@stonehenge.com>> wrote the original F<minicpan>
script.
Ricardo SIGNES <F<rjbs@cpan.org>> turned Randal's script into a module and CPAN
distribution, and has maintained it since its release as such.
This code was copyrighted in 2004, and is released under the same terms as Perl
itself.
=cut

1;
19 changes: 3 additions & 16 deletions lib/CPAN/Mini/App.pm
@@ -1,12 +1,7 @@

use strict;
use warnings;

package CPAN::Mini::App;

=head1 NAME
CPAN::Mini::App - the guts of the minicpan command
# ABSTRACT: the guts of the minicpan command

=head1 SYNOPSIS
Expand All @@ -20,7 +15,7 @@ use CPAN::Mini;
use File::HomeDir;
use File::Spec;
use Getopt::Long qw(GetOptions);
use Pod::Usage;
use Pod::Usage 1.00;

sub _display_version {
my $class = shift;
Expand All @@ -31,7 +26,7 @@ sub _display_version {
exit;
}

=head2 run
=method run
This method is called by F<minicpan> to do all the work. Don't rely on what it
does just yet.
Expand Down Expand Up @@ -90,14 +85,6 @@ Randal Schwartz's original article, which can be found here:
http://www.stonehenge.com/merlyn/LinuxMag/col42.html
=head1 AUTHORS
Randal Schwartz <F<merlyn@stonehenge.com>>
Ricardo SIGNES <F<rjbs@cpan.org>>
Copyright 2004, released under the same terms as Perl itself.
=cut

1;
10 changes: 0 additions & 10 deletions xt/release/perl-critic.t

This file was deleted.

6 changes: 0 additions & 6 deletions xt/release/pod-coverage.t

This file was deleted.

0 comments on commit 9416d1c

Please sign in to comment.