]> git.vpit.fr Git - perl/modules/CPANPLUS-Dist-Gentoo.git/blobdiff - lib/CPANPLUS/Dist/Gentoo.pm
Better handling of $file in ->update_manifest
[perl/modules/CPANPLUS-Dist-Gentoo.git] / lib / CPANPLUS / Dist / Gentoo.pm
index 49105e8bb535a99d4ea7937589768f9974e06d32..8a75c24e09e546feba90ed628a26fb6631aa2a90 100644 (file)
@@ -24,11 +24,11 @@ CPANPLUS::Dist::Gentoo - CPANPLUS backend generating Gentoo ebuilds.
 
 =head1 VERSION
 
-Version 0.07
+Version 0.08
 
 =cut
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 =head1 SYNOPSIS
 
@@ -343,7 +343,7 @@ sub create {
 
  my $OK   = sub {
   $stat->created(1);
-  $stat->dist($file);
+  $stat->dist($file) if defined $file;
   1;
  };
 
@@ -351,7 +351,7 @@ sub create {
   $stat->created(0);
   $stat->dist(undef);
   $self->_abort(@_) if @_;
-  if ($file and -f $file) {
+  if (defined $file and -f $file) {
    1 while unlink $file;
   }
   0;
@@ -365,6 +365,7 @@ sub create {
 
  if ($stat->created) {
   $self->_skip($stat->distribution, 'was already created');
+  $file = $stat->dist; # Keep the existing one.
   return $OK->();
  }
 
@@ -412,7 +413,7 @@ sub update_manifest {
  my $stat = $self->status;
 
  my $file = $stat->ebuild_file;
- unless ($file and -e $file) {
+ unless (defined $file and -e $file) {
   return $self->_abort('The ebuild file is invalid or does not exist');
  }
 
@@ -422,7 +423,7 @@ sub update_manifest {
 
  $self->_notify('Adding Manifest entry for', $stat->distribution);
 
- return $self->_run([ 'ebuild', $stat->ebuild_file, 'manifest' ], 0);
+ return $self->_run([ 'ebuild', $file, 'manifest' ], 0);
 }
 
 =head2 C<ebuild_source>
@@ -586,7 +587,7 @@ Gentoo (L<http://gentoo.org>).
 
 L<CPANPLUS>, L<IPC::Cmd> (core modules since 5.9.5), L<Parse::CPAN::Meta> (since 5.10.1).
 
-L<Cwd>, L<Carp> (since perl 5), L<File::Path> (5.001), L<File::Copy> (5.002), L<File::Spec> (5.00405).
+L<Cwd>, L<Carp> (since perl 5), L<File::Path> (5.001), L<File::Copy> (5.002), L<File::Spec> (5.00405), L<List::Util> (5.007003).
 
 =head1 SEE ALSO