Don't regenerate POD when building CPAN distro Overwriting read-only .pod files can result in errors. Simply skip `write_pod` when building the CPAN distribution.
Fixes LUCY-316. Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/9bf89ad3 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/9bf89ad3 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/9bf89ad3 Branch: refs/heads/0.6 Commit: 9bf89ad3d0e0e07c9892b73173e406e8deb041d5 Parents: d2029d7 Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Tue Nov 29 11:08:18 2016 +0100 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Tue Nov 29 11:08:18 2016 +0100 ---------------------------------------------------------------------- compiler/perl/lib/Clownfish/CFC/Perl/Build.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/9bf89ad3/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm ---------------------------------------------------------------------- diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm index dac4b2d..7d1a506 100644 --- a/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm +++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm @@ -47,8 +47,9 @@ else { # perl/ directory, leaving out all the files in ruby/, etc. However, during # development, the files are accessed from their original locations. +my $IS_CPAN_DIST = -d 'core' || -d 'cfcore'; my @BASE_PATH; -push(@BASE_PATH, updir()) unless -d 'core' || -d 'cfcore'; +push(@BASE_PATH, updir()) unless $IS_CPAN_DIST; my $AUTOGEN_DIR = 'autogen'; my $LIB_DIR = 'lib'; @@ -318,9 +319,11 @@ sub ACTION_clownfish { $core_binding->write_host_data_json($inc_dir); - print "Writing POD...\n"; - my $pod_files = $perl_binding->write_pod; - $self->add_to_cleanup($_) for @$pod_files; + unless ($IS_CPAN_DIST) { + print "Writing POD...\n"; + my $pod_files = $perl_binding->write_pod; + $self->add_to_cleanup($_) for @$pod_files; + } } # Touch autogenerated files in case the modifications were inconsequential