From: Vincent Pit Date: Sat, 11 Sep 2010 14:05:33 +0000 (+0200) Subject: Stop croaking on dists without a META file X-Git-Tag: v0.11~20 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=1ddbd8fe61633c043ec7be4e0a638bf8a30c3f74;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Stop croaking on dists without a META file This was caused by $obj->meth->{key} not autovivifying when meth returns undef. --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 051378a..e3ff153 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -364,8 +364,9 @@ sub prepare { } $stat->requires(\@requires); + my $meta = $self->meta; $stat->min_perl(CPANPLUS::Dist::Gentoo::Maps::perl_version_c2g( - eval { $self->meta->{requires}->{perl} } + $meta->{requires}->{perl} )); return $OK->(); @@ -391,6 +392,7 @@ sub meta { my $meta_file = File::Spec->catdir($extract_dir, $name); next unless -e $meta_file; + local $@; my $meta = eval { Parse::CPAN::Meta::LoadFile($meta_file) }; if (defined $meta) { $stat->meta($meta); @@ -426,7 +428,8 @@ sub intuit_license { return \@licenses if @licenses; } - my $license = $self->meta->{license}; + my $meta = $self->meta; + my $license = $meta->{license}; if (defined $license) { my @licenses = CPANPLUS::Dist::Gentoo::Maps::license_c2g($license); return \@licenses if @licenses;