App-CPAN-Fresh
view release on metacpan or search on metacpan
- Make the search more robust to work around when FriendFeed search index it not up-to-date
- Added -fi and -t to the usage doc
0.05 Wed Sep 2 02:18:55 PDT 2009
- Added -f (force) and -t (test) command line switch
0.04 Wed Sep 2 01:18:08 PDT 2009
- Rename the dist to App::CPAN::Fresh
0.03 Tue Sep 1 23:24:38 PDT 2009
- If the found upload is older than 2 days, just use your mirror
0.02 Tue Sep 1 23:06:19 PDT 2009
- Added -h option
- Display usage information when there's no arguments
0.01 Tue Sep 1 22:03:51 2009
- original version
# install devel releases too
cpanf -di Module::Name
# use cpanm
cpanf -m Module::NAme
# test
cpanf -t Module::Name
# list the recent uploads
cpanf -l
# search the latest uploads for "Catalyst"
cpanf -l Catalyst
=head1 DESCRIPTION
C<cpanf> is a command line tool to find, index and download CPAN
modules from fresh mirrors. It would be useful if you want to
install modules before it's mirrored to the mirrors near you which
usually takes a day or two.
This tool utilizes FriendFeed CPAN relatime bot
lib/App/CPAN/Fresh.pm view on Meta::CPAN
use File::Temp;
use JSON;
use LWP::UserAgent;
use URI;
my $duration = 2 * 24 * 60 * 60;
sub opt_spec {
return (
[ "install|i", "install the module" ],
[ "list|l", "list the recent uploads" ],
[ "test|t", "test the dist" ],
[ "force|f", "force install" ],
[ "devel|d", "install even if it's a devel release" ],
[ "minus|m", "use cpanminus" ],
[ "help|h", "displays usage info" ],
);
}
sub execute {
my($self, $opt, $args) = @_;
lib/App/CPAN/Fresh.pm view on Meta::CPAN
sub handle {
my($self, $opt, $dists) = @_;
my @install;
for my $dist (@$dists) {
my $path = $self->inject($dist, $opt);
if ($path) {
push @install, $path;
} else {
print "$dist is not found or not in the fresh uploads. Falling back to your mirror.\n";
push @install, $dist;
}
}
my $method = "install";
$method = "test" if $opt->{test};
if (@install) {
if ($opt->{minus}) {
system "cpanm", ($opt->{force} ? "-f" : ()), @install;
( run in 0.850 second using v1.01-cache-2.11-cpan-b16cb0d3907 )