This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add an "always update" parameter to regen_lib's open_new().
authorNicholas Clark <nick@ccl4.org>
Wed, 3 Jul 2013 13:23:33 +0000 (15:23 +0200)
committerNicholas Clark <nick@ccl4.org>
Sun, 7 Jul 2013 10:42:02 +0000 (12:42 +0200)
By default the code in regen_lib compares the newly written file it has just
closed with the (assumed) existing file, and only overwrites the existing
file if the new file differs. This is a useful behaviour for regeneration
scripts. However, it's not ideal for build scripts called from the Makefile,
as make assumes that targets will be regenerated (and the timestamp touched).

So add an "always update" parameter for the use of Makefile invoked scripts,
such as autodoc.pl. If set, delete any existing file early (so that fatal
errors during the generation don't confuse the build by leaving an existing
stale file around), skip the comparison and skip the diagnostic output
listing the changed files.

Change autodoc.pl to set this parameter.

Correct a typo in an error message in regen_lib's open_new().


No differences found