This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In pods_to_install(), use $File::Find::prune to skip t/ directories.
authorNicholas Clark <nick@ccl4.org>
Thu, 22 Dec 2011 11:07:33 +0000 (12:07 +0100)
committerNicholas Clark <nick@ccl4.org>
Sat, 24 Dec 2011 08:30:09 +0000 (09:30 +0100)
We don't want to install anything within a t/ directory. Previously the code
was determining this based on pattern matching the path. Instead of rejecting
what we find, it's more efficient to avoid scanning the directory tree in the
first place.

Porting/pod_lib.pl

index 7efe768..94cf026 100644 (file)
@@ -47,9 +47,13 @@ sub pods_to_install {
 
     File::Find::find({no_chdir=>1,
                       wanted => sub {
+                          if (m!/t\z!) {
+                              ++$File::Find::prune;
+                              return;
+                          }
+
                           # $_ is $File::Find::name when using no_chdir
                           return unless m!\.p(?:m|od)\z! && -f $_;
-                          return if m!(?:^|/)t/!;
                           return if m!lib/Net/FTP/.+\.pm\z!; # Hi, Graham! :-)
                           # Skip .pm files that have corresponding .pod files
                           return if s!\.pm\z!.pod! && -e $_;