From 879feefbc6a970dc906851765bb67335be99367b Mon Sep 17 00:00:00 2001 From: "slamm%netscape.com" Date: Tue, 18 May 1999 22:42:44 +0000 Subject: [PATCH] Ignore missing files (i.e. the dist directory is missing). General cleanup git-svn-id: svn://10.0.0.236/trunk@32127 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/config/mddepend.pl | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/mozilla/config/mddepend.pl b/mozilla/config/mddepend.pl index 64936096fd7..ec9ada256df 100644 --- a/mozilla/config/mddepend.pl +++ b/mozilla/config/mddepend.pl @@ -22,7 +22,7 @@ # files that have been removed from the build. # # Usage: -# mddepend.pl +# mddepend.pl # # Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com). @@ -32,26 +32,26 @@ $outfile = shift @ARGV; # Parse dependency files while ($line = <>) { chomp $line; - ($obj,$rest) = split /:\s+/o, $line, 2; + ($obj,$rest) = split /:\s+/, $line, 2; next if $obj eq ''; - if ($line =~ /\\$/o) { + if ($line =~ /\\$/) { chop $rest; $hasSlash = 1; } else { $hasSlash = 0; } - $deps = [ $obj, split /\s+/o, $rest ]; + $deps = [ $obj, split /\s+/, $rest ]; while ($hasSlash and $line = <>) { chomp $line; - if ($line =~ /\\$/o) { + if ($line =~ /\\$/) { chop $line; } else { $hasSlash = 0; } - $line =~ s/^\s+//o; - push @{$deps}, split /\s+/o, $line; + $line =~ s/^\s+//; + push @{$deps}, split /\s+/, $line; } push @alldeps, $deps; } @@ -67,39 +67,43 @@ foreach $deps (@alldeps) { $dep_mtime = (stat $dep_file)[9]; $modtimes{$dep_file} = $dep_mtime; } - if ($dep_mtime eq '' or $dep_mtime > $mtime) { + if ($dep_mtime ne '' and $dep_mtime > $mtime) { print "$obj($mtime) older than $dep_file($dep_mtime)\n" if $debug; push @objs, $obj; + # Object will be marked for rebuild. No need to check other dependencies. last; } } } # Output objects to rebuild (if needed). -if ($#objs > 0) { +if (@objs) { $new_output = "@objs: FORCE\n"; # Read in the current dependencies file. - open(OLD, "<$outfile") and $old_output = ; + open(OLD, "<$outfile") + and $old_output = ; close(OLD); # Only write out the dependencies if they are different. if ($new_output ne $old_output) { open(OUT, ">$outfile") and print OUT "$new_output"; - print "Updating dependencies file, $outfile.\n"; + print "Updating dependencies file, $outfile\n"; if ($debug) { - print "new: $new_output.\n"; - print "was: $old_output.\n" if $old_output ne ''; + print "new: $new_output\n"; + print "was: $old_output\n" if $old_output ne ''; } } } elsif (-s $outfile) { + # Remove the old dependencies because all objects are up to date. + print "Removing old dependencies file, $outfile\n"; + if ($debug) { - open(OLD, "<$outfile") and $old_output = ; + open(OLD, "<$outfile") + and $old_output = ; close(OLD); + print "was: $old_output\n"; } - # Remove the old dependencies because all objects are up to date. unlink $outfile; - print "Removing old dependencies file, $outfile.\n"; - print "was: $old_output.\n" if $debug; }