line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::ShouldUpdate; |
2
|
|
|
|
|
|
|
$File::ShouldUpdate::VERSION = '0.0.1'; |
3
|
1
|
|
|
1
|
|
80842
|
use strict; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
510
|
use Time::HiRes qw/ stat /; |
|
1
|
|
|
|
|
1427
|
|
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
634
|
use parent 'Exporter'; |
|
1
|
|
|
|
|
307
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
58
|
use vars qw/ @EXPORT_OK /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
153
|
|
9
|
|
|
|
|
|
|
@EXPORT_OK = qw/ should_update /; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub should_update |
12
|
|
|
|
|
|
|
{ |
13
|
2
|
|
|
2
|
1
|
19576
|
my ( $filename2, $syntax_sugar, @deps ) = @_; |
14
|
2
|
50
|
|
|
|
8
|
if ( $syntax_sugar ne ":" ) |
15
|
|
|
|
|
|
|
{ |
16
|
0
|
|
|
|
|
0
|
die qq#wrong syntax_sugar - not ":"!#; |
17
|
|
|
|
|
|
|
} |
18
|
2
|
|
|
|
|
13
|
my @stat2 = stat($filename2); |
19
|
2
|
100
|
|
|
|
54
|
if ( !@stat2 ) |
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
|
|
9
|
return 1; |
22
|
|
|
|
|
|
|
} |
23
|
1
|
|
|
|
|
5
|
foreach my $d (@deps) |
24
|
|
|
|
|
|
|
{ |
25
|
2
|
|
|
|
|
9
|
my @stat1 = stat($d); |
26
|
2
|
50
|
|
|
|
39
|
return 1 if ( $stat1[9] > $stat2[9] ); |
27
|
|
|
|
|
|
|
} |
28
|
1
|
|
|
|
|
6
|
return 0; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |