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.14 by muzaffar, Tue Oct 18 14:59:28 2011 UTC

# Line 4 | Line 4
4   #  
5   # Author: Shaun Ashby <Shaun.Ashby@cern.ch>
6   #         (with contribution from Lassi.Tuura@cern.ch)
7 # Update: 2003-11-27 16:45:18+0100
8 # Revision: $Id$
9 #
7   # Copyright: 2003 (C) Shaun Ashby
8   #
9   #--------------------------------------------------------------------
# Line 82 | Line 79 | sub getdir()
79     {
80     my $self=shift;
81     my $path=shift;
82 +   my $ignore=shift || 'CVS|\\..*';
83 +   my $match=shift || ".+";
84  
85     opendir (DIR, $path) || die "$path: cannot read: $!\n";
86     # Skip .admin and CVS subdirectories too.
87     # Also skip files that look like backup files or files being modified with emacs:
88 <   my @items = map { "$path/$_" } grep ((-d "$path/$_") && ($_!~/^(CVS|\..*)$/),readdir(DIR));
88 >   my @items = map { "$path/$_" } grep ((-d "$path/$_") && ($_=~/^($match)$/) && ($_!~/^($ignore)$/),readdir(DIR));
89     closedir (DIR);
90     return @items;
91     }
# Line 168 | Line 167 | sub checktree()
167     # Otherwise use the cache as the list of items we need to change.
168     my $cached = $self->{DIRCACHE}{$path};  
169     my @items = ();
170 +   my $matchdir='[a-zA-Z0-9][a-zA-Z0-9-_]*';
171  
172     if (! -d _)
173        {
# Line 178 | Line 178 | sub checktree()
178        {
179        # When a directory is added, this block is activated
180        $self->{ADDEDDIR}{$path}=1;
181 <      $self->{DIRCACHE}{$path} = [ (stat(_))[9], @items = $self->getdir($path) ];
181 >      $self->{DIRCACHE}{$path} = [ (stat(_))[9], @items = $self->getdir($path,'',$matchdir) ];
182        $required = 1;
183        $self->cachestatus(1);
184        }
# Line 191 | Line 191 | sub checktree()
191        # update can be taken recursively from this dir:
192        #$self->modified_parentdirs($path);
193        # Current subdirs:
194 <      my %curdirs = map { $_ => 1 } $self->getdir($path);
194 >      my %curdirs = map { $_ => 1 } $self->getdir($path,'',$matchdir);
195        my %olddirs = ();
196        for (my $i = 1; $i <= $#$cached; $i++)
197           {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines