This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
write_buildcustomize.pl no longer writes to STDOUT
authorNicholas Clark <nick@ccl4.org>
Wed, 12 Jun 2013 12:42:15 +0000 (14:42 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 13 Jun 2013 13:19:21 +0000 (15:19 +0200)
commitb78ac7159b42a0e0bd59ab07411d2f5ef09e1d7e
tree402f6c1ac5e8d7abfa1ae5a6d81f06d06506cdf9
parentf6b3c354c9a2b091250502d4d877969b8a1185a0
write_buildcustomize.pl no longer writes to STDOUT

write_buildcustomize.pl now opens lib/buildcustomize.pl itself, instead of
writing to STDOUT and relying on the Makefile to set up redirection. This
means that an empty lib/buildcustomize.pl is not created if
write_buildcustomize.pl fails to compile (for whatever reason), and permits
write_buildcustomize.pl to delete (or attempt to delete) the output file if
it detects an error.

Hard code the output file name (lib/buildcustomize.pl), as it's the same on
all platforms, and @ARGV is already used to optionally pass a directory for
write_buildcustomize.pl to change to before running.

Experimentation suggests that various make utilities don't delete a file
created by redirection even if an error occurs. Hence this should be more
robust.

Add -f to the miniperl commandline when running write_buildcustomize.pl to
avoid reading in any existing lib/buildcustomize.pl. write_buildcustomize.pl
doesn't need the setup provided by lib/buildcustomize.pl, and running it
might cause errors which prevents writing out a correct version, making an
incomplete build harder to recover from.
Makefile.SH
vms/descrip_mms.template
win32/Makefile
win32/makefile.mk
write_buildcustomize.pl