diff options
author | Max Maischein <corion@corion.net> | 2013-10-03 18:17:39 +0200 |
---|---|---|
committer | Max Maischein <corion@corion.net> | 2013-10-06 19:48:08 +0200 |
commit | 192f56b06136953e14ef490067000185cc351337 (patch) | |
tree | d49c78b4f34a9efda2109e3394416a014089bc1c /Porting | |
parent | 132246f2f9bbbe9b47a59225d9250987fed15100 (diff) | |
download | perl-192f56b06136953e14ef490067000185cc351337.tar.gz |
Elide use of `rm`
We remove the reliance on an external 'rm' tool in
favour of using File::Path::remove_tree.
We also eliminate some dir-changing by using
more absolute directory names.
Diffstat (limited to 'Porting')
-rwxr-xr-x | Porting/sync-with-cpan | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Porting/sync-with-cpan b/Porting/sync-with-cpan index dee39ee187..9f8fb544c5 100755 --- a/Porting/sync-with-cpan +++ b/Porting/sync-with-cpan @@ -114,7 +114,7 @@ Handle complicated C<FILES> This is an initial version; no attempt has been made yet to make this portable. It shells out instead of trying to find a Perl solution. -In particular, it assumes wget, git, tar, chmod, perl, make, and rm +In particular, it assumes git, chmod, perl, and make to be available. =cut @@ -128,6 +128,7 @@ use strict; use warnings; use Getopt::Long; use Archive::Tar; +use File::Path qw( remove_tree ); $| = 1; @@ -301,7 +302,7 @@ FILE: for my $file ( `find $new_dir -type f` ) { rename $old_file => $file; } -system 'rm', '-rf', $new_dir; +remove_tree( $new_dir ); if (-f "$old_dir/.gitignore") { say "Restoring .gitignore"; @@ -416,16 +417,15 @@ print "done\n"; # print "About to clean up; hit return or abort (^C) "; <STDIN>; -chdir "cpan"; -system rm => '-r', $old_dir; -unlink $new_file unless $tarball; +remove_tree( "cpan/$old_dir" ); +unlink "cpan/$new_file" unless $tarball; # # Run the tests. First the test belonging to the module, followed by the # the tests in t/porting # -chdir "../t"; +chdir "t"; say "Running module tests"; my @test_files = `find ../cpan/$pkg_dir -name '*.t' -type f`; chomp @test_files; |