ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Cache/Cache.pm
(Generate patch)

Comparing COMP/SCRAM/src/Cache/Cache.pm (file contents):
Revision 1.11 by muzaffar, Fri Jan 14 17:36:42 2011 UTC vs.
Revision 1.12 by muzaffar, Mon Sep 5 09:01:19 2011 UTC

# Line 82 | Line 82 | sub getdir()
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     }
# Line 168 | Line 170 | sub checktree()
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        {
# Line 178 | Line 181 | sub checktree()
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        }
# Line 191 | Line 194 | sub checktree()
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           {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines