line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
50564
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
2
|
|
|
|
|
|
|
package File::Find::Rule::CVS; |
3
|
1
|
|
|
1
|
|
5
|
use File::Find::Rule; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
849
|
use Parse::CVSEntries; |
|
1
|
|
|
|
|
15512
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
860
|
use version; |
|
1
|
|
|
|
|
2373
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
67
|
use base 'File::Find::Rule'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
88
|
|
7
|
1
|
|
|
1
|
|
4
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
477
|
|
8
|
|
|
|
|
|
|
$VERSION = '0.01'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
File::Find::Rule::CVS - find files based on CVS metadata |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
use File::Find::Rule::CVS; |
17
|
|
|
|
|
|
|
my @modified = find( cvs_modified => in => 'sandbox' ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
File::Find::Rule::CVS extends File::Find::Rule to add clauses based on |
22
|
|
|
|
|
|
|
the contents of CVS/Entries files. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 RULES |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub File::Find::Rule::_cvs_entry { |
29
|
15
|
|
|
15
|
|
23
|
my $self = shift; |
30
|
15
|
|
|
|
|
23
|
my ($file, $path) = @_; |
31
|
|
|
|
|
|
|
|
32
|
15
|
100
|
|
|
|
105
|
return $self->{_entries}{ $path }{ $file } |
33
|
|
|
|
|
|
|
if exists $self->{_entries}{ $path }; |
34
|
|
|
|
|
|
|
|
35
|
7
|
100
|
|
|
|
38
|
my $parse = Parse::CVSEntries->new( "CVS/Entries" ) |
36
|
|
|
|
|
|
|
or return; |
37
|
|
|
|
|
|
|
|
38
|
4
|
|
|
|
|
2961
|
$self->{_entries}{ $path } = { map { $_->name => $_ } $parse->entries }; |
|
8
|
|
|
|
|
55
|
|
39
|
4
|
|
|
|
|
163
|
return $self->{_entries}{ $path }{ $file }; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 cvs_modified |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Matches a file which the cvs sandbox thinks is modified |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub File::Find::Rule::cvs_modified () { |
49
|
1
|
|
|
1
|
0
|
2328
|
my $self = shift()->_force_object; |
50
|
|
|
|
|
|
|
my $sub = sub { |
51
|
4
|
100
|
|
4
|
|
1021
|
my $entry = $self->_cvs_entry( @_ ) or return; |
52
|
2
|
|
|
|
|
21
|
return (stat $_)[9] > $entry->mtime; |
53
|
1
|
|
|
|
|
12
|
}; |
54
|
1
|
|
|
|
|
6
|
$self->exec( $sub ); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 cvs_unknown |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Matches an entry in a working directory that CVS doesn't know about |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub File::Find::Rule::cvs_unknown () { |
65
|
1
|
|
|
1
|
0
|
950
|
my $self = shift()->_force_object; |
66
|
|
|
|
|
|
|
my $sub = sub { |
67
|
3
|
|
|
3
|
|
609
|
return !$self->_cvs_entry( @_ ); |
68
|
1
|
|
|
|
|
8
|
}; |
69
|
1
|
|
|
|
|
5
|
$self->exec( $sub ); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 cvs_version( $test ) |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Matches files with versions that match $test. $test is a |
76
|
|
|
|
|
|
|
Number::Compare expression applied to a L object. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub File::Find::Rule::cvs_version { |
81
|
2
|
|
|
2
|
0
|
1991
|
my $self = shift()->_force_object; |
82
|
2
|
|
|
|
|
22
|
my $test = Number::Compare->new( shift ); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
my $sub = sub { |
85
|
8
|
100
|
|
8
|
|
5715
|
my $entry = $self->_cvs_entry( @_ ) |
86
|
|
|
|
|
|
|
or return; |
87
|
4
|
|
|
|
|
18
|
my $version = version->new( $entry->version ); |
88
|
4
|
|
|
|
|
159
|
return $test->( $version ); |
89
|
2
|
|
|
|
|
278
|
}; |
90
|
2
|
|
|
|
|
11
|
$self->exec( $sub ); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
__END__ |