r9166@llin: dpavlin | 2006-01-31 17:36:56 +0100
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 31 Jan 2006 16:37:14 +0000 (16:37 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Tue, 31 Jan 2006 16:37:14 +0000 (16:37 +0000)
 more fixes for operation without Hyper Estraier

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@326 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_updatedb

index fc8fbac..fc282ac 100755 (executable)
@@ -113,8 +113,8 @@ sub hest_update {
 
        my $skip_check = $opt{j} && print STDERR "Skipping check for existing files -- this should be used only with initital import\n";
 
 
        my $skip_check = $opt{j} && print STDERR "Skipping check for existing files -- this should be used only with initital import\n";
 
-       unless (defined($index_node_url)) {
-               print STDERR "HyperEstraier support not enabled in configuration\n";
+       unless ($index_node_url && $index_node_url =~ m#^http://#) {
+               print STDERR "HyperEstraier support not enabled or index node invalid\n" if ($debug);
                $index_node_url = 0;
                return;
        }
                $index_node_url = 0;
                return;
        }
@@ -197,7 +197,7 @@ sub hest_update {
                while (my $row = $sth->fetchrow_hashref()) {
 
                        my $uri = $row->{hname} . ':' . $row->{sname} . '#' . $row->{backupnum} . ' ' . $row->{filepath};
                while (my $row = $sth->fetchrow_hashref()) {
 
                        my $uri = $row->{hname} . ':' . $row->{sname} . '#' . $row->{backupnum} . ' ' . $row->{filepath};
-                       unless ($skip_check && $hest_node) {
+                       if (! $skip_check && $hest_node) {
                                my $id = $hest_node->uri_to_id($uri);
                                next if ($id && $id == -1);
                        }
                                my $id = $hest_node->uri_to_id($uri);
                                next if ($id && $id == -1);
                        }
@@ -224,11 +224,8 @@ sub hest_update {
                        print STDERR $doc->dump_draft,"\n" if ($debug > 1);
 
                        # register the document object to the database
                        print STDERR $doc->dump_draft,"\n" if ($debug > 1);
 
                        # register the document object to the database
-                       if ($hest_node) {
-                               $hest_node->put_doc($doc);
-                       } else {
-                               die "not supported";
-                       }
+                       $hest_node->put_doc($doc) if ($hest_node);
+
                        $added++;
                }
 
                        $added++;
                }