[Module-build-checkins] Module-Build/t/lib DistGen.pm,1.15,1.16
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2006-01-27 03:12:34
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8096/t/lib Modified Files: DistGen.pm Log Message: Simplify the clean() method Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- DistGen.pm 4 Dec 2005 08:48:09 -0000 1.15 +++ DistGen.pm 27 Jan 2006 03:12:25 -0000 1.16 @@ -284,31 +284,22 @@ my $filename = $self->_real_filename( $file ); my $dirname = File::Basename::dirname( $filename ); - $names{files}{$filename} = 0; + $names{$filename} = 0; my @dirs = File::Spec->splitdir( $dirname ); while ( @dirs ) { my $dir = File::Spec->catdir( @dirs ); - $names{dirs}{$dir} = 0; + $names{$dir} = 0; pop( @dirs ); } } File::Find::finddepth( sub { - my $dir = File::Spec->canonpath( $File::Find::dir ); my $name = File::Spec->canonpath( $File::Find::name ); - if ( -d && not exists $names{dirs}{$name} ) { - print "Removing directory '$name'\n" if $VERBOSE; + if ( not exists $names{$name} ) { + print "Removing '$name'\n" if $VERBOSE; File::Path::rmtree( $_ ); - return; - } elsif ( -d ) { - return; - } elsif ( exists $names{files}{$name} ) { - #print "Leaving file '$name'\n" if $VERBOSE; - } else { - print "Unlinking file '$name'\n" if $VERBOSE; - 1 while unlink( $_ ); } }, File::Spec->curdir ); |