diff options
Diffstat (limited to 'gnu/usr.bin/perl/cpan/File-Path')
-rw-r--r-- | gnu/usr.bin/perl/cpan/File-Path/lib/File/Path.pm | 20 | ||||
-rw-r--r-- | gnu/usr.bin/perl/cpan/File-Path/t/Path-Class.t | 50 | ||||
-rwxr-xr-x | gnu/usr.bin/perl/cpan/File-Path/t/Path.t | 36 | ||||
-rw-r--r-- | gnu/usr.bin/perl/cpan/File-Path/t/Path_win32.t | 2 |
4 files changed, 31 insertions, 77 deletions
diff --git a/gnu/usr.bin/perl/cpan/File-Path/lib/File/Path.pm b/gnu/usr.bin/perl/cpan/File-Path/lib/File/Path.pm index 138bdc24ffb..b4fb5a2c483 100644 --- a/gnu/usr.bin/perl/cpan/File-Path/lib/File/Path.pm +++ b/gnu/usr.bin/perl/cpan/File-Path/lib/File/Path.pm @@ -18,7 +18,7 @@ BEGIN { use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); -$VERSION = '2.13'; +$VERSION = '2.15'; $VERSION = eval $VERSION; @ISA = qw(Exporter); @EXPORT = qw(mkpath rmtree); @@ -633,7 +633,7 @@ File::Path - Create or remove directory trees =head1 VERSION -2.13 - released May 31 2017. +2.15 - released June 07 2017. =head1 SYNOPSIS @@ -774,12 +774,14 @@ identical to C<make_path()>. The C<remove_tree> function deletes the given directories and any files and subdirectories they might contain, much like the Unix -command C<rm -rf> or the Windows commands C<rmdir /s> and C<rd /s>. The -only exception to the function similarity is that C<remove_tree> accepts -only directories whereas C<rm -rf> also accepts files. +command C<rm -rf> or the Windows commands C<rmdir /s> and C<rd /s>. -The function accepts a list of directories to be -removed. Its behaviour may be tuned by an optional hashref +The function accepts a list of directories to be removed. (In point of fact, +it will also accept filesystem entries which are not directories, such as +regular files and symlinks. But, as its name suggests, its intent is to +remove trees rather than individual files.) + +C<remove_tree()>'s behaviour may be tuned by an optional hashref appearing as the last parameter on the call. If an empty string is passed to C<remove_tree>, an error will occur. @@ -1244,7 +1246,7 @@ James (Jim) Keenan <F<jkeenan@cpan.org>>. =head1 CONTRIBUTORS -Contributors to File::Path, in alphabetical order. +Contributors to File::Path, in alphabetical order by first name. =over 1 @@ -1258,6 +1260,8 @@ Contributors to File::Path, in alphabetical order. =item John Lightsey <F<john@perlsec.org>> +=item Nigel Horne <F<njh@bandsman.co.uk>> + =item Richard Elberger <F<riche@cpan.org>> =item Ryan Yee <F<ryee@cpan.org>> diff --git a/gnu/usr.bin/perl/cpan/File-Path/t/Path-Class.t b/gnu/usr.bin/perl/cpan/File-Path/t/Path-Class.t deleted file mode 100644 index d896fbbf553..00000000000 --- a/gnu/usr.bin/perl/cpan/File-Path/t/Path-Class.t +++ /dev/null @@ -1,50 +0,0 @@ -use strict; -use warnings; -use Test::More tests => 32; - -eval "require Path::Class"; - - -SKIP: { - skip "Path::Class required to run this test", 32 if $@; - use File::Path qw(remove_tree make_path); - Path::Class->import; - - my $name = 'test'; - my $dir = dir($name); - - for my $mk_dir ($name, dir($name)) { - for my $mk_pass_arg (0, 1) { - - for my $rm_dir ($name, dir($name)) { - for my $rm_pass_arg (0, 1) { - remove_tree($name) if -e $name; - - my ($mk_args, $mk_desc) = test($mk_dir, $mk_pass_arg); - make_path(@$mk_args); - - if (ok( -d $dir, "we made $dir ($mk_desc)")) { - my ($rm_args, $rm_desc) = test($rm_dir, $rm_pass_arg); - remove_tree(@$rm_args); - ok( ! -d $dir, "...then we removed $dir ($rm_desc)"); - } else { - fail("...can't remove it if we didn't create it"); - } - } - } - } - } -} - -sub test { - my ($dir, $pass_arg) = @_; - - my $args = [ $dir, ($pass_arg ? {} : ()) ]; - my $desc = sprintf( - 'dir isa %s, second arg is %s', - (ref($dir) || 'string'), - ($pass_arg ? '{}' : 'not passed') - ); - - return ($args, $desc); -} diff --git a/gnu/usr.bin/perl/cpan/File-Path/t/Path.t b/gnu/usr.bin/perl/cpan/File-Path/t/Path.t index 9be39a5de2f..8ea3d87c9a5 100755 --- a/gnu/usr.bin/perl/cpan/File-Path/t/Path.t +++ b/gnu/usr.bin/perl/cpan/File-Path/t/Path.t @@ -3,7 +3,7 @@ use strict; -use Test::More tests => 167; +use Test::More tests => 165; use Config; use Fcntl ':mode'; use lib './t'; @@ -758,7 +758,7 @@ is( # remove_tree(): Permit re-use of options hash without issuing a warning my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| a b c | ); + create_3_level_subdirs( qw| ZoYhvc6RmGnl S2CrQ0lju0o7 lvOqVYWpfhcP | ); my @created; @created = File::Path::make_path($deepest, { mode => 0711 }); is(scalar(@created), 3, "Created 3 subdirectories"); @@ -816,20 +816,20 @@ is( } SKIP: { - my $skip_count = 5; + my $skip_count = 3; skip "Windows will not set this error condition", $skip_count if $^O eq 'MSWin32'; # mkpath() with hashref: case of phony user my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| d e f | ); + create_3_level_subdirs( qw| Hhu1KpF4EVAV vUj5k37bih8v Vkdw02POXJxj | ); my (@created, $error); my $user = join('_' => 'foobar', $$); @created = mkpath($deepest, { mode => 0711, user => $user, error => \$error }); - TODO: { - local $TODO = "Notwithstanding the phony 'user', mkpath will actually create subdirectories; should it?"; - is(scalar(@created), 0, "No subdirectories created"); - } +# TODO: { +# local $TODO = "Notwithstanding the phony 'user', mkpath will actually create subdirectories; should it?"; +# is(scalar(@created), 0, "No subdirectories created"); +# } is(scalar(@$error), 1, "caught error condition" ); my ($file, $message) = each %{$error->[0]}; like($message, @@ -843,7 +843,7 @@ SKIP: { { # mkpath() with hashref: case of valid uid my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| j k l | ); + create_3_level_subdirs( qw| b5wj8CJcc7gl XTJe2C3WGLg5 VZ_y2T0XfKu3 | ); my (@created, $error); @created = mkpath($deepest, { mode => 0711, uid => $>, error => \$error }); is(scalar(@created), 3, "Provide valid 'uid' argument: 3 subdirectories created"); @@ -858,7 +858,7 @@ SKIP: { # mkpath() with hashref: case of valid owner my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| m n o | ); + create_3_level_subdirs( qw| aiJEDKaAEH25 nqhXsBM_7_bv qfRj4cur4Jrs | ); my (@created, $error); my $name = getpwuid($>); @created = mkpath($deepest, { mode => 0711, owner => $name, error => \$error }); @@ -874,14 +874,14 @@ SKIP: { # mkpath() with hashref: case of phony group my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| p q r | ); + create_3_level_subdirs( qw| nOR4lGRMdLvz NnwkEHEVL5li _3f1Kv6q77yA | ); my (@created, $error); my $bad_group = join('_' => 'foobarbaz', $$); @created = mkpath($deepest, { mode => 0711, group => $bad_group, error => \$error }); - TODO: { - local $TODO = "Notwithstanding the phony 'group', mkpath will actually create subdirectories; should it?"; - is(scalar(@created), 0, "No subdirectories created"); - } +# TODO: { +# local $TODO = "Notwithstanding the phony 'group', mkpath will actually create subdirectories; should it?"; +# is(scalar(@created), 0, "No subdirectories created"); +# } is(scalar(@$error), 1, "caught error condition" ); my ($file, $message) = each %{$error->[0]}; like($message, @@ -895,7 +895,7 @@ SKIP: { { # mkpath() with hashref: case of valid group my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| s t u | ); + create_3_level_subdirs( qw| BEcigvaBNisY rd4lJ1iZRyeS OyQnDPIBxP2K | ); my (@created, $error); @created = mkpath($deepest, { mode => 0711, group => $(, error => \$error }); is(scalar(@created), 3, "Provide valid 'group' argument: 3 subdirectories created"); @@ -910,7 +910,7 @@ SKIP: { # mkpath() with hashref: case of valid group my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| v w x | ); + create_3_level_subdirs( qw| IayhWFDvys8X gTd6gaeuFzmV VVI6UWLJCOEC | ); my (@created, $error); my $group_name = (getgrgid($())[0]; @created = mkpath($deepest, { mode => 0711, group => $group_name, error => \$error }); @@ -926,7 +926,7 @@ SKIP: { # mkpath() with hashref: case of valid owner and group my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| delta epsilon zeta | ); + create_3_level_subdirs( qw| xsmOvlnxOqJc olsGlBSoVUpp tDuRilkD35rd | ); my (@created, $error); my $name = getpwuid($>); my $group_name = (getgrgid($())[0]; diff --git a/gnu/usr.bin/perl/cpan/File-Path/t/Path_win32.t b/gnu/usr.bin/perl/cpan/File-Path/t/Path_win32.t index 89b0b2f045c..2638f996225 100644 --- a/gnu/usr.bin/perl/cpan/File-Path/t/Path_win32.t +++ b/gnu/usr.bin/perl/cpan/File-Path/t/Path_win32.t @@ -37,7 +37,7 @@ cmp_ok($removed, '>', 0, "removed $removed entries from $UNC_path"); { my ($least_deep, $next_deepest, $deepest) = - create_3_level_subdirs( qw| d e f | ); + create_3_level_subdirs( qw| IsVFFJfJ03Rk jD7ToWQFmcjm hMZR6S1qNSf5 | ); my (@created, $error); my $user = join('_' => 'foobar', $$); { |