# New Ticket Created by Steve Fink # Please include the string: [perl #16853] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16853 >
This patch makes re-running Configure.pl avoid updating the timestamps on the generated .h (and many other) files iff the files did not actually change. This is really only helpful to people who are working on the Configure system and are sick of having to rebuild everything to test their changes. It should be safe to apply for everyone, but I don't know if it's a good idea. -- attachment 1 ------------------------------------------------------ url: http://rt.perl.org/rt2/attach/36039/29157/a85e11/config-ifdiff.patch
Index: config/gen/config_h.pl =================================================================== RCS file: /cvs/public/parrot/config/gen/config_h.pl,v retrieving revision 1.2 diff -p -u -r1.2 config_h.pl --- config/gen/config_h.pl 7 Jun 2002 01:12:39 -0000 1.2 +++ config/gen/config_h.pl 29 Aug 2002 17:31:22 -0000 @@ -9,9 +9,12 @@ $description="Generating config.h..."; @args=(); sub runstep { - genfile('config/gen/config_h/config_h.in', 'include/parrot/config.h'); + genfile('config/gen/config_h/config_h.in', 'include/parrot/config.h', + ignorePattern => 'PARROT_CONFIG_DATE'); - open(HH, ">include/parrot/has_header.h") or die "Can't open has_header.h: $!"; + my $hh = "include/parrot/has_header.h"; + open(HH, ">$hh.tmp") + or die "Can't open has_header.h: $!"; print HH qq( /* @@ -32,6 +35,8 @@ sub runstep { } close HH; + + copy_if_diff("$hh.tmp", $hh); } 1; Index: config/gen/platform.pl =================================================================== RCS file: /cvs/public/parrot/config/gen/platform.pl,v retrieving revision 1.2 diff -p -u -r1.2 platform.pl --- config/gen/platform.pl 8 Jun 2002 04:13:28 -0000 1.2 +++ config/gen/platform.pl 29 Aug 2002 17:31:22 -0000 @@ -2,8 +2,7 @@ package Configure::Step; use strict; use vars qw($description @args); -use Parrot::Configure::Step; -use File::Copy 'copy'; +use Parrot::Configure::Step qw(copy_if_diff); $description="Moving platform files into place..."; @@ -16,11 +15,8 @@ sub runstep { $platform="ansi" if defined($_[0]); $platform="generic" unless -e "config/gen/platform/$platform.c"; - copy("config/gen/platform/$platform.c", "platform.c"); - copy("config/gen/platform/$platform.h", "include/parrot/platform.h"); - - my $now=time; - utime $now, $now, "platform.c", "include/parrot/platform.h"; + copy_if_diff("config/gen/platform/$platform.c", "platform.c"); + copy_if_diff("config/gen/platform/$platform.h", "include/parrot/platform.h"); } 1;