| 1 | package MyCPAN::Indexer::Queue::FromList; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use parent qw(MyCPAN::Indexer::Queue); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use vars qw($VERSION $logger); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | $VERSION = '1.282'; | |||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use Log::Log4perl; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | $logger = Log::Log4perl->get_logger( 'Queue' ); | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | =encoding utf8 | ||||||||||
| 16 | |||||||||||
| 17 | =head1 NAME | ||||||||||
| 18 | |||||||||||
| 19 | MyCPAN::Indexer::Queue::FromList - Try to index distributions listed in a file | ||||||||||
| 20 | |||||||||||
| 21 | =head1 SYNOPSIS | ||||||||||
| 22 | |||||||||||
| 23 | Use this in backpan_indexer.pl by specifying it as the queue class: | ||||||||||
| 24 | |||||||||||
| 25 | # in backpan_indexer.config | ||||||||||
| 26 | queue_class MyCPAN::Indexer::Queue::FromList | ||||||||||
| 27 | |||||||||||
| 28 | =head1 DESCRIPTION | ||||||||||
| 29 | |||||||||||
| 30 | This class returns a list of Perl distributions for the BackPAN | ||||||||||
| 31 | indexer to process. It selects the distributions that had previous | ||||||||||
| 32 | indexing errors by extracting the distribution path from the error | ||||||||||
| 33 | report. If the distribution isn't in the same place it was during | ||||||||||
| 34 | the original indexing, it won't be in the queue. | ||||||||||
| 35 | |||||||||||
| 36 | =over | ||||||||||
| 37 | |||||||||||
| 38 | =cut | ||||||||||
| 39 | |||||||||||
| 40 | sub _get_file_list | ||||||||||
| 41 | 0 | ▶ | { | ||||||||
|
Subroutine
_get_file_list: not called CC=4 SCAR=30.0
| |||||||||||
| 42 | 0 | my( $self ) = @_; | |||||||||
| 43 | |||||||||||
| 44 | 0 | my $file = $self->get_config->distribution_list; | |||||||||
| 45 | 0 | $logger->debug( "Taking dists from [$file]" ); | |||||||||
| 46 | 0 | ▶ | $logger->error( "Distribution file [$file] does not exist" ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | unless -e $file; | ||||||||||
| 48 | |||||||||||
| 49 | 0 | chomp( my @files = do { local( @ARGV ) = $file; <> } ); | |||||||||
| 50 | 0 | $logger->debug( "Found " . @files . " error reports" ); | |||||||||
| 51 | |||||||||||
| 52 | 0 | my @queue; | |||||||||
| 53 | 0 | foreach my $file ( @files ) | |||||||||
| 54 | { | ||||||||||
| 55 | 0 | $logger->debug( "Looking for distribution [$file]" ); | |||||||||
| 56 | 0 | ▶ | if( -e $file ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 57 | { | ||||||||||
| 58 | 0 | push @queue, $file; | |||||||||
| 59 | } | ||||||||||
| 60 | else | ||||||||||
| 61 | { | ||||||||||
| 62 | 0 | $logger->error( "Could not find [$file]: not adding to queue" ); | |||||||||
| 63 | } | ||||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 0 | return \@queue; | |||||||||
| 67 | } | ||||||||||
| 68 | |||||||||||
| 69 | 1 | 1; | |||||||||
| 70 | |||||||||||
| 71 | =back | ||||||||||
| 72 | |||||||||||
| 73 | =head1 SEE ALSO | ||||||||||
| 74 | |||||||||||
| 75 | MyCPAN::Indexer, MyCPAN::Indexer::Tutorial, MyCPAN::Indexer::Queue | ||||||||||
| 76 | |||||||||||
| 77 | =head1 SOURCE AVAILABILITY | ||||||||||
| 78 | |||||||||||
| 79 | This code is in Github: | ||||||||||
| 80 | |||||||||||
| 81 | git://github.com/briandfoy/mycpan-indexer.git | ||||||||||
| 82 | |||||||||||
| 83 | =head1 AUTHOR | ||||||||||
| 84 | |||||||||||
| 85 | brian d foy, C<< <bdfoy@cpan.org> >> | ||||||||||
| 86 | |||||||||||
| 87 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 88 | |||||||||||
| 89 | Copyright © 2010-2018, brian d foy <bdfoy@cpan.org>. All rights reserved. | ||||||||||
| 90 | |||||||||||
| 91 | You may redistribute this under the terms of the Artistic License 2.0. | ||||||||||
| 92 | |||||||||||
| 93 | =cut | ||||||||||