82 |
|
{ |
83 |
|
my $self=shift; |
84 |
|
my $path=shift; |
85 |
+ |
my $ignore=shift || 'CVS|\\..*'; |
86 |
+ |
my $match=shift || ".+"; |
87 |
|
|
88 |
|
opendir (DIR, $path) || die "$path: cannot read: $!\n"; |
89 |
|
# Skip .admin and CVS subdirectories too. |
90 |
|
# Also skip files that look like backup files or files being modified with emacs: |
91 |
< |
my @items = map { "$path/$_" } grep ((-d "$path/$_") && ($_!~/^(CVS|\..*)$/),readdir(DIR)); |
91 |
> |
my @items = map { "$path/$_" } grep ((-d "$path/$_") && ($_=~/^($match)$/) && ($_!~/^($ignore)$/),readdir(DIR)); |
92 |
|
closedir (DIR); |
93 |
|
return @items; |
94 |
|
} |
170 |
|
# Otherwise use the cache as the list of items we need to change. |
171 |
|
my $cached = $self->{DIRCACHE}{$path}; |
172 |
|
my @items = (); |
173 |
+ |
my $matchdir='[a-zA-Z0-9].+'; |
174 |
|
|
175 |
|
if (! -d _) |
176 |
|
{ |
181 |
|
{ |
182 |
|
# When a directory is added, this block is activated |
183 |
|
$self->{ADDEDDIR}{$path}=1; |
184 |
< |
$self->{DIRCACHE}{$path} = [ (stat(_))[9], @items = $self->getdir($path) ]; |
184 |
> |
$self->{DIRCACHE}{$path} = [ (stat(_))[9], @items = $self->getdir($path,'',$matchdir) ]; |
185 |
|
$required = 1; |
186 |
|
$self->cachestatus(1); |
187 |
|
} |
194 |
|
# update can be taken recursively from this dir: |
195 |
|
#$self->modified_parentdirs($path); |
196 |
|
# Current subdirs: |
197 |
< |
my %curdirs = map { $_ => 1 } $self->getdir($path); |
197 |
> |
my %curdirs = map { $_ => 1 } $self->getdir($path,'',$matchdir); |
198 |
|
my %olddirs = (); |
199 |
|
for (my $i = 1; $i <= $#$cached; $i++) |
200 |
|
{ |