X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=d5d87c43c0f63322a4fec4c88beca8247677e624;hb=29445aa70c5502e06d4ed53334e650a33b2efc28;hp=7fab73a43b693e5817857f0261481292115a6669;hpb=88382900dcd1a7b94384f5bebf6f6c47bf610613;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 7fab73a..d5d87c4 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -348,23 +348,39 @@ sub create { $self->SUPER::create(@_); - if ($stat->do_manifest) { - unless (File::Copy::copy($stat->fetched_arch => $stat->distdir)) { - error "Couldn\'t copy the distribution file to distdir ($!) -- aborting"; - 1 while unlink $file; - return $FAIL->(); - } - - msg 'Adding Manifest entry for ' . $stat->distribution; - unless ($self->_run([ 'ebuild', $file, 'manifest' ], 0)) { - 1 while unlink $file; - return $FAIL->(); - } + if ($stat->do_manifest and not $self->update_manifest) { + 1 while unlink $file; + return $FAIL->(); } return $OK->(); } +=head2 C + +Update the F file for the ebuild associated to the current dist object. + +=cut + +sub update_manifest { + my $self = shift; + my $stat = $self->status; + + my $file = $stat->eb_file; + unless ($file and -e $file) { + error 'The ebuild file is invalid or does not exist -- aborting'; + return 0; + } + + unless (File::Copy::copy($stat->fetched_arch => $stat->distdir)) { + error "Couldn\'t copy the distribution file to distdir ($!) -- aborting"; + return 0; + } + + msg 'Adding Manifest entry for ' . $stat->distribution; + return $self->_run([ 'ebuild', $stat->eb_file, 'manifest' ], 0); +} + sub _cpan2portage { my ($self, $name, $version) = @_;