From: Vincent Pit Date: Thu, 3 Sep 2009 20:01:04 +0000 (+0200) Subject: Make fatal the failure to map a dependency to an ebuild X-Git-Tag: v0.08~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=3770352fb8ffd4eb59c6310ed899b62b785696a0;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Make fatal the failure to map a dependency to an ebuild --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 49de892..70fc27b 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -389,7 +389,9 @@ sub create { { open my $eb, '>', $file or return $FAIL->("open($file): $!"); - print $eb $self->ebuild_source; + my $source = $self->ebuild_source; + return $FAIL->() unless defined $source; + print $eb $source; } return $FAIL->() if $stat->do_manifest and not $self->update_manifest; @@ -423,7 +425,7 @@ sub update_manifest { =head2 C -Returns the source of the ebuild for the current dist object. +Returns the source of the ebuild for the current dist object, or C when one of the dependencies couldn't be mapped to an existing ebuild. =cut @@ -434,11 +436,14 @@ sub ebuild_source { # We must resolve the deps now and not inside prepare because _cpan2portage # has to see the ebuilds already generated for the dependencies of the current # dist. - my @deps = do { - my %seen; - sort grep !$seen{$_}++, 'dev-lang/perl', - map $self->_cpan2portage(@$_), @{$stat->deps} - }; + my @deps; + for (@{$stat->deps}) { + my $dep = $self->_cpan2portage(@$_); + return unless defined $dep; + push @deps, $dep; + } + + @deps = do { my %seen; sort grep !$seen{$_}++, 'dev-lang/perl', @deps }; my $d = $stat->header; $d .= "# Generated by CPANPLUS::Dist::Gentoo version $VERSION\n\n"; @@ -492,11 +497,11 @@ sub _cpan2portage { } - $self->_skip( + $self->_abort( "Couldn't find an appropriate ebuild for $name in the portage tree" ); - return ''; + return; } sub install {