Re: [PATCH] Update File-Path to 2.00
David Landgren [Tue, 5 Jun 2007 23:21:40 +0000 (01:21 +0200)]
Message-ID: <4665D3E4.2030809@landgren.net>

Silences some unnecessary carping (e.g. from ExtUtils::Command line 109
when building perl).

p4raw-id: //depot/perl@31336

lib/File/Path.pm
lib/File/Path.t

index ad0a38d..6e1a17b 100644 (file)
@@ -502,7 +502,7 @@ sub rmtree {
             push @{${$arg->{error}}}, {'' => "No root path(s) specified"};
     }
     else {
-            _carp ("No root path(s) specified\n");
+            $arg->{verbose} and _carp ("No root path(s) specified\n");
         }
       return 0;
     }
index ce85b73..055fc46 100755 (executable)
@@ -252,7 +252,7 @@ and can't restore permissions to \d+
     $dir2 = catdir($base,'B');
 
     stderr_like(
-        \&rmtree,
+        sub { rmtree( [], 1 ) },
         qr/\ANo root path\(s\) specified\b/,
         "rmtree of nothing carps sensibly"
     );