From 86a0e96b8343928b4cf1e2d23fd145b0414f8649 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 9 Aug 2002 03:35:47 +0000 Subject: [PATCH] No need to slurp the idstr unless we're actually going to update the generated file. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1634 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- bin/gendobj | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/gendobj b/bin/gendobj index e7dd7068c..261ea5458 100755 --- a/bin/gendobj +++ b/bin/gendobj @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: gendobj,v 1.13 2002/06/06 07:18:10 mdb Exp $ +# $Id: gendobj,v 1.14 2002/08/09 03:35:47 mdb Exp $ # # gendobj is used to generate DObject source file definitons basded on # abbreviated declarations. Because DObject fields all have standard @@ -31,6 +31,14 @@ while ($source = shift) { next; } + # if the destination file is newer than the source file, do nothing + my $dmtime = (stat($dest))[9]; + my $smtime = (stat($source))[9]; + if (!$force && (defined $dmtime) && ($dmtime > $smtime)) { + warn "Skipping $source as source is newer.\n" if ($verbose); + next; + } + # if the destination file already exists, slurp the existing CVS Id # information out of it so that we can slip that into the new one my $idstr; @@ -43,14 +51,6 @@ while ($source = shift) { close(IN); } - # if the destination file is newer than the source file, do nothing - my $dmtime = (stat($dest))[9]; - my $smtime = (stat($source))[9]; - if (!$force && (defined $dmtime) && ($dmtime > $smtime)) { - warn "Skipping $source as source is newer.\n" if ($verbose); - next; - } - if (!open(IN, "$source")) { warn "Unable to open $source for reading: $!\n"; next;