/[BackupPC]/trunk/bin/BackupPC_updatedb
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/bin/BackupPC_updatedb

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

revision 305 by dpavlin, Sat Jan 28 19:49:18 2006 UTC revision 306 by dpavlin, Sat Jan 28 20:42:42 2006 UTC
# Line 104  sub curr_time { Line 104  sub curr_time {
104          return strftime($t_fmt,localtime());          return strftime($t_fmt,localtime());
105  }  }
106    
 my $hest_db;  
107  my $hest_node;  my $hest_node;
108    
 sub signal {  
         my($sig) = @_;  
         if ($hest_db) {  
                 print "\nCaught a SIG$sig--syncing database and shutting down\n";  
                 $hest_db->sync();  
                 $hest_db->close();  
         }  
         exit(0);  
 }  
   
 $SIG{'INT'}  = \&signal;  
 $SIG{'QUIT'} = \&signal;  
   
109  sub hest_update {  sub hest_update {
110    
111          my ($host_id, $share_id, $num) = @_;          my ($host_id, $share_id, $num) = @_;
# Line 141  sub hest_update { Line 127  sub hest_update {
127    
128          print " opening index $index_node_url";          print " opening index $index_node_url";
129          if ($index_node_url) {          if ($index_node_url) {
130                  $hest_node ||= Search::Estraier::Node->new($index_node_url);                  $hest_node ||= Search::Estraier::Node->new(
131                  $hest_node->set_auth('admin', 'admin');                          url => $index_node_url,
132                            user => 'admin',
133                            passwd => 'admin',
134                            croak_on_error => 1,
135                    );
136                  print " via node URL";                  print " via node URL";
137          } else {          } else {
138                  die "don't know how to use Hyper Estraier Index $index_node_url";                  die "don't know how to use Hyper Estraier Index $index_node_url";
# Line 193  sub hest_update { Line 183  sub hest_update {
183    
184                  if ($results == 0) {                  if ($results == 0) {
185                          print " - no new files\n";                          print " - no new files\n";
186                          last;                          return;
187                  } else {                  } else {
188                          print " - $results files: ";                          print " - $results files: ";
189                  }                  }
# Line 211  sub hest_update { Line 201  sub hest_update {
201                          my $uri = 'file:///' . $fid;                          my $uri = 'file:///' . $fid;
202    
203                          unless ($skip_check) {                          unless ($skip_check) {
204                                  my $id = ($hest_db || $hest_node)->uri_to_id($uri);                                  my $id = $hest_node->uri_to_id($uri);
205                                  next unless ($id == -1);                                  next if ($id && $id == -1);
206                          }                          }
207    
208                          # create a document object                          # create a document object

Legend:
Removed from v.305  
changed lines
  Added in v.306

  ViewVC Help
Powered by ViewVC 1.1.26