/[hyperestraier_wrappers]/trunk/perl/scripts/est-spider
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/perl/scripts/est-spider

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29 by dpavlin, Sat Sep 17 23:55:09 2005 UTC revision 33 by dpavlin, Tue Oct 11 14:04:52 2005 UTC
# Line 32  my $result = GetOptions( Line 32  my $result = GetOptions(
32    
33  my $dir = shift @ARGV || die "usage: $0 [dir]";  my $dir = shift @ARGV || die "usage: $0 [dir]";
34    
35    if (! -e $dir) {
36            warn "directory $dir doesn't exist, skipping\n";
37            exit 1;
38    }
39    
40  #my $basedir = $0;  #my $basedir = $0;
41  #$basedir =~ s,/[^/]+$,/,;  #$basedir =~ s,/[^/]+$,/,;
42  #require "$basedir/filter.pm";  #require "$basedir/filter.pm";
# Line 138  sub file { Line 143  sub file {
143    
144          return if (! $force && -l $path || $path =~ m#/.svn# || $path =~ m/(~|.bak)$/);          return if (! $force && -l $path || $path =~ m#/.svn# || $path =~ m/(~|.bak)$/);
145    
146          my $mtime = (stat($path))[9];          my $mtime = (stat($path))[9] || -1;
147          my $mtime_db = $db->get_doc_attr_by_uri("file:///$path", '@mtime') || -2;          my $mtime_db = $db->get_doc_attr_by_uri("file:///$path", '@mtime') || -2;
148    
149          if ($mtime == $mtime_db) {          if ($mtime == $mtime_db) {
# Line 186  sub file { Line 191  sub file {
191                          $pre_html =~ s/<title><\/title>/<title>$file_only :: page ##page_nr##<\/title>/si;                          $pre_html =~ s/<title><\/title>/<title>$file_only :: page ##page_nr##<\/title>/si;
192                  }                  }
193    
194                    # save empty entry as a placeholder
195                    dump_contents($db, ' ', $mtime, "$path");
196    
197                  my $page_nr = 1;                  my $page_nr = 1;
198                  foreach my $page (split(/\f/s,$pages)) {                  foreach my $page (split(/\f/s,$pages)) {
199                          print STDERR " $page_nr" if ($verbose);                          print STDERR " $page_nr" if ($verbose);
200                          my $pre_tmp = $pre_html;                          my $pre_tmp = $pre_html;
201                          $pre_tmp =~ s/##page_nr##/$page_nr<\/title>/s;                          $pre_tmp =~ s/##page_nr##/$page_nr<\/title>/s;
202                          dump_contents($db, $pre_tmp . $page . $post_html, $mtime, $path) if ($page !~ m/^\s*$/s);                          dump_contents($db, $pre_tmp . $page . $post_html, $mtime, "$path#$page_nr") if ($page !~ m/^\s*$/s);
203                          $page_nr++;                          $page_nr++;
204                  }                  }
205    

Legend:
Removed from v.29  
changed lines
  Added in v.33

  ViewVC Help
Powered by ViewVC 1.1.26