diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2014-12-28 15:59:38 -0500 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-12-30 15:10:23 +0000 |
commit | 989c251f8fe733cc99daad2f2b7e558ee5938b48 (patch) | |
tree | 086cb890cf447d6bd032c98af4460c134ec01545 | |
parent | 33be4c6111bea619c1662d201ad9e3914c2013e5 (diff) | |
download | perl-989c251f8fe733cc99daad2f2b7e558ee5938b48.tar.gz |
fix a broken optimization in win32/config_h.PL to stop excessive rebuilding
In commit 137443ea0a config_h.PL was introduced. There is no ML archive
from that time of the actual patches or their rational. From day 1 of
config_h.PL for the root config.h, it didn't copy the new one config.h to
the normal location of config.h if the files matched. This prevents
redundant dirtying of all core moudules with the
"Makefile out-of-date with respect to "/make clean/rerunning of makefile.pl
/new make all cycle. But the optimization didn't work in practice since
the modules declare a dependency on /lib/CORE/config.h not /config.h.
Previously "touch"ing /win32/Makefile would trigger a mass rebuild,
even if config.h's contents are the same. Now only if the new after
"touch"ing /win32/makefile config.h is different from the old config.h
, will a mass rebuild of module be triggered. This makes reduced the
amount of time core devs have to spend to work on Win32 perl.
-rw-r--r-- | win32/config_h.PL | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/win32/config_h.PL b/win32/config_h.PL index 6b7fbda974..03dddb3b8a 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -79,10 +79,11 @@ while (<SH>) close(H); close(SH); - -chmod(0666,"$opt{CORE_DIR}/$opt{CONFIG_H}"); -copy("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}") || die "Cannot copy:$!"; -chmod(0444,"$opt{CORE_DIR}/$opt{CONFIG_H}"); +if (compare("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}")) { + chmod(0666,"$opt{CORE_DIR}/$opt{CONFIG_H}"); + copy("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}") || die "Cannot copy:$!"; + chmod(0444,"$opt{CORE_DIR}/$opt{CONFIG_H}"); +} if (compare("$file.new",$file)) { |