summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
index b7d209b1031..7e507e62b95 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
@@ -4,7 +4,7 @@ package Pod::Simple::Search;
use strict;
use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
-$VERSION = '3.16'; ## Current version of this package
+$VERSION = '3.20'; ## Current version of this package
BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level
use Carp ();
@@ -25,7 +25,7 @@ use Cwd qw( cwd );
#==========================================================================
__PACKAGE__->_accessorize( # Make my dumb accessor methods
'callback', 'progress', 'dir_prefix', 'inc', 'laborious', 'limit_glob',
- 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name',
+ 'limit_re', 'shadows', 'verbose', 'name2path', 'path2name', 'recurse',
);
#==========================================================================
@@ -39,6 +39,7 @@ sub new {
sub init {
my $self = shift;
$self->inc(1);
+ $self->recurse(1);
$self->verbose(DEBUG);
return $self;
}
@@ -127,9 +128,11 @@ sub _make_search_callback {
my $self = $_[0];
# Put the options in variables, for easy access
- my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress,$path2name,$name2path) =
+ my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress,
+ $path2name, $name2path, $recurse) =
map scalar($self->$_()),
- qw(laborious verbose shadows limit_re callback progress path2name name2path);
+ qw(laborious verbose shadows limit_re callback progress
+ path2name name2path recurse);
my($file, $shortname, $isdir, $modname_bits);
return sub {
@@ -137,6 +140,11 @@ sub _make_search_callback {
if($isdir) { # this never gets called on the startdir itself, just subdirs
+ unless( $recurse ) {
+ $verbose and print "Not recursing into '$file' as per requested.\n";
+ return 'PRUNE';
+ }
+
if( $self->{'_dirs_visited'}{$file} ) {
$verbose and print "Directory '$file' already seen, skipping.\n";
return 'PRUNE';