line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MyCPAN::Indexer::Queue::ModifiedSince; |
2
|
1
|
|
|
1
|
|
986
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
4
|
use parent qw(MyCPAN::Indexer::Queue); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
67
|
use vars qw($VERSION $logger); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
7
|
|
|
|
|
|
|
$VERSION = '1.28_12'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
6
|
use File::Basename; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
10
|
1
|
|
|
1
|
|
5
|
use File::Find; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
11
|
1
|
|
|
1
|
|
5
|
use File::Find::Closures qw( find_by_regex ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
61
|
|
12
|
1
|
|
|
1
|
|
6
|
use File::Path qw( mkpath ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
13
|
1
|
|
|
1
|
|
5
|
use File::Spec::Functions qw( catfile rel2abs ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
14
|
1
|
|
|
1
|
|
4
|
use Log::Log4perl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
BEGIN { |
17
|
1
|
|
|
1
|
|
42
|
$logger = Log::Log4perl->get_logger( 'Queue' ); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
MyCPAN::Indexer::Queue - Find distributions to index |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Use this in backpan_indexer.pl by specifying it as the queue class: |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# in backpan_indexer.config |
29
|
|
|
|
|
|
|
queue_class MyCPAN::Indexer::Queue::ModifiedSince |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRIPTION |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This class returns a list of Perl distributions for the BackPAN |
34
|
|
|
|
|
|
|
indexer to process. It returns from the backpan directories the |
35
|
|
|
|
|
|
|
files modified in the last day (not yet configurable). |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 Methods |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over 4 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item get_queue |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
C sets the key C in C<$Notes> hash reference. It |
44
|
|
|
|
|
|
|
finds all of the tarballs or zip archives in under the directories |
45
|
|
|
|
|
|
|
named in C and C in the configuration. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
It specifically skips files that end in C<.txt.gz> or C<.data.gz> |
48
|
|
|
|
|
|
|
since PAUSE creates those meta files near the actual module |
49
|
|
|
|
|
|
|
installations. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
If the C configuration value is true, it also copies |
52
|
|
|
|
|
|
|
any distributions it finds into a PAUSE-like structure using the |
53
|
|
|
|
|
|
|
value of the C configuration to create the path. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _get_file_list |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
0
|
|
|
my( $self, @dirs ) = @_; |
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
$logger->debug( "Taking dists from [@dirs]" ); |
62
|
0
|
|
|
|
|
|
my( $wanted, $reporter ) = |
63
|
|
|
|
|
|
|
File::Find::Closures::find_by_modified_after( time - 24*60*60 ); |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
find( $wanted, @dirs ); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return [ |
68
|
0
|
|
0
|
|
|
|
map { rel2abs($_) } |
|
0
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
grep { ! /.(data|txt).gz$/ and ! /02packages/ } |
70
|
|
|
|
|
|
|
$reporter->() |
71
|
|
|
|
|
|
|
]; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=back |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SEE ALSO |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
MyCPAN::Indexer, MyCPAN::Indexer::Tutorial |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SOURCE AVAILABILITY |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This code is in Github: |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
git://github.com/briandfoy/mycpan-indexer.git |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
brian d foy, C<< >> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Copyright (c) 2008-2013, brian d foy, All Rights Reserved. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
You may redistribute this under the same terms as Perl itself. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |