line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################### |
2
|
|
|
|
|
|
|
package Gaim::Log::Finder; |
3
|
|
|
|
|
|
|
########################################### |
4
|
1
|
|
|
1
|
|
70638
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
6
|
1
|
|
|
1
|
|
7
|
use Log::Log4perl qw(:easy); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
631
|
use File::Find (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
477
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
########################################### |
12
|
|
|
|
|
|
|
sub new { |
13
|
|
|
|
|
|
|
########################################### |
14
|
1
|
|
|
1
|
1
|
206
|
my($class, @options) = @_; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
48
|
my ($home) = glob "~"; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
2
|
my $start_dir; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
3
|
for (qw(.purple .gaim)) { |
21
|
2
|
|
|
|
|
3
|
my $dir = "$home/$_"; |
22
|
|
|
|
|
|
|
|
23
|
2
|
50
|
|
|
|
22
|
if(-d $dir) { |
24
|
0
|
|
|
|
|
0
|
$start_dir = "$dir/logs"; |
25
|
0
|
|
|
|
|
0
|
last; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $self = { |
30
|
|
|
|
|
|
|
start_dir => $start_dir, |
31
|
0
|
|
|
0
|
|
0
|
callback => sub { 1 }, |
32
|
1
|
|
|
|
|
7
|
@options, |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
6
|
return bless $self, $class; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
########################################### |
39
|
|
|
|
|
|
|
sub find { |
40
|
|
|
|
|
|
|
########################################### |
41
|
1
|
|
|
1
|
1
|
7
|
my($self, $start_dir) = @_; |
42
|
|
|
|
|
|
|
|
43
|
1
|
50
|
|
|
|
8
|
$start_dir = $self->{start_dir} unless |
44
|
|
|
|
|
|
|
defined $start_dir; |
45
|
|
|
|
|
|
|
|
46
|
8
|
|
|
8
|
|
42
|
File::Find::find sub { $self->wanted() }, |
47
|
1
|
|
|
|
|
96
|
$start_dir; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
########################################### |
51
|
|
|
|
|
|
|
sub wanted { |
52
|
|
|
|
|
|
|
########################################### |
53
|
8
|
|
|
8
|
0
|
9
|
my($self) = @_; |
54
|
|
|
|
|
|
|
|
55
|
8
|
50
|
|
|
|
46
|
return if $File::Find::name =~ m#$self->{start_dir}/(.*?)/(.*?)/.system/#; |
56
|
8
|
|
|
|
|
8
|
my $path = $File::Find::name; |
57
|
|
|
|
|
|
|
|
58
|
8
|
|
|
|
|
50
|
my($protocol, $local_user, $remote_user, $file) = |
59
|
|
|
|
|
|
|
$path =~ m#$self->{start_dir}/(.*?)/(.*?)/(.*?)/(.*\.txt)$#; |
60
|
|
|
|
|
|
|
|
61
|
8
|
100
|
|
|
|
292
|
if(defined $file) { |
62
|
4
|
|
|
|
|
10
|
$self->{callback}->($self, |
63
|
|
|
|
|
|
|
$File::Find::name, |
64
|
|
|
|
|
|
|
$protocol, |
65
|
|
|
|
|
|
|
$local_user, |
66
|
|
|
|
|
|
|
$remote_user, |
67
|
|
|
|
|
|
|
$file |
68
|
|
|
|
|
|
|
); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__END__ |