Skip to content

Commit

Permalink
Better error message when dist_version_from fails
Browse files Browse the repository at this point in the history
(Original patch modified by David Golden <dagolden@cpan.org)
  • Loading branch information
chorny authored and xdg committed Aug 25, 2010
1 parent 6cb5327 commit 97be9e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ Revision history for Perl extension Module::Build.

0.36_16 -

Bug fixes:

- Better error message in case package declaration is not found
when searching for version. [Alexandr Ciornii]

0.36_15 - Wed Aug 25 10:41:28 EDT 2010

Bug fixes:
Expand Down
4 changes: 4 additions & 0 deletions lib/Module/Build/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,11 @@ sub dist_version {
my $version_from = File::Spec->catfile( split( qr{/}, $dist_version_from ) );
my $pm_info = Module::Build::ModuleInfo->new_from_file( $version_from )
or die "Can't find file $version_from to determine version";
#$p->{dist_version} is undef here
$p->{dist_version} = $self->normalize_version( $pm_info->version() );
unless (defined $p->{dist_version}) {
die "Can't determine distribution version from $version_from";
}
}

die ("Can't determine distribution version, must supply either 'dist_version',\n".
Expand Down

0 comments on commit 97be9e7

Please sign in to comment.