1 |
+ |
# |
2 |
+ |
# Check a product composition file to see if any of its components have |
3 |
+ |
# changed |
4 |
+ |
# |
5 |
+ |
|
6 |
+ |
use FileHandle; |
7 |
+ |
|
8 |
+ |
my $datefile=shift @ARGV; |
9 |
+ |
my $productfile=shift @ARGV; |
10 |
+ |
my @depfiles=@ARGV; |
11 |
+ |
$self={}; |
12 |
+ |
# get dates in our dependency list |
13 |
+ |
foreach $file ( @depfiles ) { |
14 |
+ |
if ( -e $file ) { |
15 |
+ |
$self->{moddate}{$file}=(stat($file))[9]; |
16 |
+ |
} |
17 |
+ |
} |
18 |
+ |
|
19 |
+ |
# create a new dependencyfile |
20 |
+ |
$fh=FileHandle->new(); |
21 |
+ |
open ($fh, ">".$datefile ); |
22 |
+ |
foreach $file ( @depfiles ) { |
23 |
+ |
#print $file." ".$self->{moddate}{$file}."\n"; |
24 |
+ |
print $fh $file."\n"; |
25 |
+ |
print $fh $self->{moddate}{$file}."\n"; |
26 |
+ |
} |
27 |
+ |
close $fh; |