diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2009-05-30 11:07:57 -0600 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-06-06 00:15:40 +0200 |
commit | 813720522fb5f54e39efcf9e4103d762ad005f51 (patch) | |
tree | fb1510f2fb3e42dfe3d5b1ca46347b1513ee6944 /overload.pl | |
parent | e8b9ce6006d3ecb2b02af04e4406ccb4294e728c (diff) | |
download | perl-813720522fb5f54e39efcf9e4103d762ad005f51.tar.gz |
overload.pl shouldnt update its output unconditionally
fix overload.pl to use rename_if_different, imitating reentr.pl
(including commenting safer_unlink rather than scrubbing it).
Leave lib/overload/number.pm unconditionally generated,
since it is not a dependency for make perl
With this, "make regen perl; make regen perl" will recompile at most 1x.
In turn, this improves utility of regen as an added default make target.
Diffstat (limited to 'overload.pl')
-rw-r--r-- | overload.pl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/overload.pl b/overload.pl index b9c5cc670e..a7dec35cd4 100644 --- a/overload.pl +++ b/overload.pl @@ -32,9 +32,9 @@ while (<DATA>) { push @names, $name; } -safer_unlink ('overload.h', 'overload.c', catfile(qw(lib overload numbers.pm))); -my $c = safer_open("overload.c"); -my $h = safer_open("overload.h"); +safer_unlink (catfile(qw(lib overload numbers.pm))); +my $c = safer_open("overload.c-new"); +my $h = safer_open("overload.h-new"); mkdir("lib/overload") unless -d catdir(qw(lib overload)); my $p = safer_open(catfile(qw(lib overload numbers.pm))); @@ -150,6 +150,8 @@ EOT safer_close($h); safer_close($c); safer_close($p); +rename_if_different("overload.c-new", "overload.c"); +rename_if_different("overload.h-new","overload.h"); __DATA__ # Fallback should be the first |