ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/scramds
Revision: 1.1.2.1
Committed: Wed Dec 1 15:14:55 1999 UTC (25 years, 5 months ago) by williamc
Branch: V0_9branch
CVS Tags: V0_10_17, V0_10_16, V0_10_15, V0_10_14, V0_10_13, V0_10_12, V0_10_11, V0_10_10, V0_10_0, V0_10_9, V0_10_8, V0_10_7, V0_10_6
Changes since 1.1: +50 -0 lines
Log Message:
Add make workaround to rebuild on any datestamp change

File Contents

# User Rev Content
1 williamc 1.1.2.1 #!/usr/local/bin/perl5 -w
2    
3     #
4     # Check a product composition file to see if any of its components have
5     # changed
6     #
7    
8     use FileHandle;
9    
10     my $datefile=shift @ARGV;
11     my $productfile=shift @ARGV;
12     my $needsupdate=0;
13     $self={};
14     # read in dependencies and dates
15     my $file;
16     if ( -f $datefile ) {
17     $fh=FileHandle->new();
18     open ($fh, "<".$datefile );
19     while ( <$fh> ) {
20     $file=$_;
21     chomp $file;
22     $self->{file}{$file}=<$fh>;
23     chomp $self->{file}{$file};
24     }
25     close $fh;
26     }
27    
28     # now get dates in our dependency list
29     foreach $file ( keys %{$self->{file}} ) {
30     if ( -f $file ) {
31     $self->{moddate}{$file}=(stat($file))[9];
32     if ( $self->{moddate}{$file} != $self->{file}{$file} ) {
33     $date=$self->{moddate}{$file}-1;
34     $needsupdate=1;
35     }
36     }
37     }
38    
39     # time stamp the product file to be older than th e dependencies
40     if ( $needsupdate==1 ) { # touch file into the past
41     if ( $ENV{DEBUG} ) {
42     print "Blasting $productfile to the past\n";
43     }
44     utime($date,$date,$productfile);
45     }
46     else {
47     if ( $ENV{DEBUG} ) {
48     print "No need to touch $productfile\n";
49     }
50     }