Skip to content
Browse files

Merge fixes from seveas

  • Loading branch information...
2 parents f95b0b3 + 4dd9a47 commit 68ca5e2134406c8f1db57a1aba3c79d0178366cb @acme committed Jan 25, 2012
Showing with 7 additions and 6 deletions.
  1. +2 −0 MANIFEST
  2. +4 −5 lib/CPAN/Unpack.pm
  3. +1 −1 t/local.t
View
2 MANIFEST
@@ -9,3 +9,5 @@ t/cpan/authors/id/L/LB/LBROCARD/GraphViz-1.8.tar.gz
t/cpan/modules/02packages.details.txt.gz
t/local.t
t/pod.t
+META.yml Module YAML meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by MakeMaker)
View
9 lib/CPAN/Unpack.pm
@@ -76,17 +76,16 @@ sub unpack {
}
if ( defined($unpacked)
- && $unpacked eq $unpacked_versions{ $distribution->dist } )
+ && $unpacked eq $unpacked_versions{ $distribution->dist }
+ && -d $want )
{
- print "Skipping " . $distribution->prefix . " ($counter)\n"
- unless $self->quiet;
next;
}
if ( -d $want ) {
print "Deleting old version of " . $distribution->dist . "\n"
unless $self->quiet;
- rmtree "$destination/$want";
+ rmtree $want;
}
print "Unpacking " . $distribution->prefix . " ($counter)\n"
@@ -106,7 +105,7 @@ sub unpack {
my $files = @files;
if ( $files == 1 ) {
my $file = $files[0];
- if ( S_ISDIR( stat($file) ) ) {
+ if ( S_ISDIR( ( stat( $file ) )[2] ) ) {
rename $file, $want;
} else {
mkdir $want;
View
2 t/local.t
@@ -17,5 +17,5 @@ ok( -d "t/unpacked/Acme-Buffy" );
ok( -d "t/unpacked/Acme-Colour" );
ok( -d "t/unpacked/GraphViz" );
-my @files = <t/unpacked/GraphViz/GraphViz-1.8/*>;
+my @files = <t/unpacked/GraphViz/*>;
is( scalar(@files), 7 );

0 comments on commit 68ca5e2

Please sign in to comment.
Something went wrong with that request. Please try again.