From: Vincent Pit Date: Fri, 4 Sep 2009 17:07:10 +0000 (+0200) Subject: Preserve the existing $stat->dist when the dist has already been created X-Git-Tag: v0.08~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=commitdiff_plain;h=94531017fe542019334bea7ad734cc71236ba2ee Preserve the existing $stat->dist when the dist has already been created As ->prepare may have already set it. --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 49105e8..c31f21f 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -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->(); }