perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-docs/lib/DocSet Cache.pm DocSet.pm NavigateCache.pm
Date Wed, 09 Apr 2003 06:39:52 GMT
stas        2003/04/08 23:39:51

  Modified:    lib/DocSet Cache.pm DocSet.pm NavigateCache.pm
  Log:
  sync:
  - a few bug fixes
  - always check that cache read succeeded
  
  Revision  Changes    Path
  1.8       +2 -1      modperl-docs/lib/DocSet/Cache.pm
  
  Index: Cache.pm
  ===================================================================
  RCS file: /home/cvs/modperl-docs/lib/DocSet/Cache.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Cache.pm	9 Apr 2003 06:23:38 -0000	1.7
  +++ Cache.pm	9 Apr 2003 06:39:51 -0000	1.8
  @@ -31,7 +31,7 @@
           $self->read();
       }
   
  -    if ($purge || update) {
  +    if ($purge || $update) {
           # we will reconstruct the ids order to make sure to reflect the
           # changes in added and removed items (and those who have changed
           # their order)
  @@ -64,6 +64,7 @@
   }
   
   sub purge {
  +    my $self = shift;
       if (-e $self->{path}) {
           note "!!! Removing cache file $self->{path}";
           unlink $self->{path};
  
  
  
  1.17      +5 -1      modperl-docs/lib/DocSet/DocSet.pm
  
  Index: DocSet.pm
  ===================================================================
  RCS file: /home/cvs/modperl-docs/lib/DocSet/DocSet.pm,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DocSet.pm	9 Apr 2003 06:23:38 -0000	1.16
  +++ DocSet.pm	9 Apr 2003 06:39:51 -0000	1.17
  @@ -381,7 +381,11 @@
       # each output mode need its own cache, because of the destination
       # links which are different
       my $mode = $self->get('tmpl_mode');
  -    my $cache = DocSet::Cache->new("$src_root/cache.$mode.dat");
  +    my $path = "$src_root/cache.$mode.dat";
  +    my $cache = DocSet::Cache->new($path);
  +
  +    die "Failed to read cache from $path: " . $cache->read_error
  +        if $cache->read_error;
   
       # render the objects no matter what kind are they
       for my $obj ($self->stored_objects) {
  
  
  
  1.7       +9 -3      modperl-docs/lib/DocSet/NavigateCache.pm
  
  Index: NavigateCache.pm
  ===================================================================
  RCS file: /home/cvs/modperl-docs/lib/DocSet/NavigateCache.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NavigateCache.pm	14 Nov 2002 17:45:31 -0000	1.6
  +++ NavigateCache.pm	9 Apr 2003 06:39:51 -0000	1.7
  @@ -192,9 +192,15 @@
   
   
   sub get_cache {
  -    my($cache_path) = @_;
  -    $CACHE{$cache_path} ||= DocSet::Cache->new($cache_path);
  -    return $CACHE{$cache_path};
  +    my($path) = @_;
  +
  +    unless ($CACHE{$path}) {
  +        $CACHE{$path} = DocSet::Cache->new($path);
  +        die "Failed to read cache from $path: " . $CACHE{$path}->read_error
  +            if $CACHE{$path}->read_error;
  +    }
  +
  +    return $CACHE{$path};
   }
   
   
  
  
  

Mime
View raw message