[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.485,1.486
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <kwi...@us...> - 2005-09-23 21:42:14
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv807/lib/Module/Build Modified Files: Base.pm Log Message: Ditto for AUTHOR and ABSTRACT Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.485 retrieving revision 1.486 diff -u -d -r1.485 -r1.486 --- Base.pm 23 Sep 2005 21:37:39 -0000 1.485 +++ Base.pm 23 Sep 2005 21:42:06 -0000 1.486 @@ -766,8 +766,10 @@ my $member = "dist_$part"; return $p->{$member} if defined $p->{$member}; - return unless $p->{dist_version_from}; - my $fh = IO::File->new($p->{dist_version_from}) or return; + my $docfile = $self->_main_docfile + or return; + my $fh = IO::File->new($docfile) + or return; require Module::Build::PodParser; my $parser = Module::Build::PodParser->new(fh => $fh); @@ -2448,11 +2450,15 @@ eval {require Pod::Text; 1} ? Pod::Text->new : die "Can't load Pod::Readme or Pod::Text to create README"; $self->log_info("Creating README using " . ref($parser) . "\n"); + $parser->parse_from_file($self->_main_docfile, 'README', @_); + $self->_add_to_manifest('MANIFEST', 'README'); +} + +sub _main_docfile { + my $self = shift; my $pm_file = $self->dist_version_from; (my $pod_file = $pm_file) =~ s/.pm$/.pod/; - $parser->parse_from_file - ((-e $pod_file ? $pod_file : $pm_file), 'README', @_); - $self->_add_to_manifest('MANIFEST', 'README'); + return (-e $pod_file ? $pod_file : $pm_file); } sub ACTION_distdir { |