Index: /trunk/gsdl/perllib/lucenebuilder.pm
===================================================================
--- /trunk/gsdl/perllib/lucenebuilder.pm	(revision 13588)
+++ /trunk/gsdl/perllib/lucenebuilder.pm	(revision 13589)
@@ -70,9 +70,9 @@
     if ($exe eq ".exe")
     {
-      $self->{'full_lucene_passes_exe'} = "perl$exe \"$lucene_passes_script\"";
+	$self->{'full_lucene_passes_exe'} = "perl$exe \"$lucene_passes_script\"";
     }
     else
     {
-      $self->{'full_lucene_passes_exe'} = "perl -S \"$lucene_passes_script\"";
+	$self->{'full_lucene_passes_exe'} = "perl -S \"$lucene_passes_script\"";
     }
 
@@ -99,5 +99,5 @@
 # this writes a nice version of the text docs
 sub compress_text
-  {
+{
     my $self = shift (@_);
     # we don't do anything if we don't want compressed text
@@ -114,15 +114,15 @@
     my $osextra = "";
     if ($ENV{'GSDLOS'} =~ /^windows$/i)
-      {
-    $text_dir =~ s@/@\\@g;
-      }
+    {
+	$text_dir =~ s@/@\\@g;
+    }
     else
-      {
-    if ($outhandle ne "STDERR")
-          {
-        # so lucene_passes doesn't print to stderr if we redirect output
-        $osextra .= " 2>/dev/null";
-          }
-      }
+    {
+	if ($outhandle ne "STDERR")
+	{
+	    # so lucene_passes doesn't print to stderr if we redirect output
+	    $osextra .= " 2>/dev/null";
+	}
+    }
 
     # get any os specific stuff
@@ -138,9 +138,9 @@
 
     if ($self->{'debug'})
-      {
-    $handle = STDOUT;
-      }
+    {
+	$handle = STDOUT;
+    }
     else
-      {
+    {
         print STDERR "Full Path:     $full_lucene_passes\n";
         print STDERR "Executable:    $full_lucene_passes_exe\n";
@@ -148,18 +148,18 @@
         print STDERR "Build Dir:     $build_dir\n";
         print STDERR "Cmd:           $full_lucene_passes_exe text $lucene_passes_sections \"$build_dir\" \"dummy\"   $osextra\n";
-    if (!-e "$full_lucene_passes" ||
-        !open (PIPEOUT, "| $full_lucene_passes_exe text $lucene_passes_sections \"$build_dir\" \"dummy\"   $osextra"))
-          {
-        print STDERR "<FatalError name='NoRunLucenePasses'/>\n</Stage>\n" if $self->{'gli'};
-        die "lucenebuilder::build_index - couldn't run $full_lucene_passes_exe\n";
-          }
-    $handle = lucenebuilder::PIPEOUT;
-      }
+	if (!-e "$full_lucene_passes" ||
+	    !open (PIPEOUT, "| $full_lucene_passes_exe text $lucene_passes_sections \"$build_dir\" \"dummy\"   $osextra"))
+	{
+	    print STDERR "<FatalError name='NoRunLucenePasses'/>\n</Stage>\n" if $self->{'gli'};
+	    die "lucenebuilder::build_index - couldn't run $full_lucene_passes_exe\n";
+	}
+	$handle = lucenebuilder::PIPEOUT;
+    }
     my $levels = $self->{'levels'};
     my $gdbm_level = "document";
     if ($levels->{'section'})
-      {
-    $gdbm_level = "section";
-      }
+    {
+	$gdbm_level = "section";
+    }
 
     undef $levels->{'paragraph'}; # get rid of para if we had it.
@@ -174,7 +174,7 @@
     $self->{'buildproc'}->reset();
     &plugin::begin($self->{'pluginfo'}, $self->{'source_dir'},
-           $self->{'buildproc'}, $self->{'maxdocs'});
+		   $self->{'buildproc'}, $self->{'maxdocs'});
     &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
-           "", {}, $self->{'buildproc'}, $self->{'maxdocs'}, 0, $self->{'gli'});
+		   "", {}, $self->{'buildproc'}, $self->{'maxdocs'}, 0, $self->{'gli'});
     &plugin::end($self->{'pluginfo'});
     close ($handle) unless $self->{'debug'};
@@ -183,5 +183,5 @@
 
     print STDERR "</Stage>\n" if $self->{'gli'};
-  }
+}
 
 sub build_indexes {
@@ -192,7 +192,7 @@
     my $indexes = [];
     if (defined $indexname && $indexname =~ /\w/) {
-    push @$indexes, $indexname;
+	push @$indexes, $indexname;
     } else {
-    $indexes = $self->{'collect_cfg'}->{'indexes'};
+	$indexes = $self->{'collect_cfg'}->{'indexes'};
     }
 
@@ -203,27 +203,27 @@
     # build each of the indexes
     foreach $index (@$indexes) {
-    if ($self->want_built($index)) {
-
-        my $idx = $self->{'index_mapping'}->{$index};
-        foreach my $level (keys %{$self->{'levels'}}) {
-        next if $level =~ /paragraph/; # we don't do para indexing
-        my ($pindex) = $level =~ /^(.)/;
-        # should probably check that new name with level
-        # is unique ... but currently (with doc sec and para)
-        # each has unique first letter.
-        $self->{'index_mapping'}->{$index} = $pindex.$idx;
-
-        my $llevel = $mgppbuilder::level_map{$level};
-        print $outhandle "\n*** building index $index at level $llevel in subdirectory " .
-            "$self->{'index_mapping'}->{$index}\n" if ($self->{'verbosity'} >= 1);
-        print STDERR "<Stage name='Index' source='$index' level=$llevel>\n" if $self->{'gli'};
-
-        $self->build_index($index,$llevel);
-        }
-        $self->{'index_mapping'}->{$index} = $idx;
-
-    } else {
-        print $outhandle "\n*** ignoring index $index\n" if ($self->{'verbosity'} >= 1);
-    }
+	if ($self->want_built($index)) {
+
+	    my $idx = $self->{'index_mapping'}->{$index};
+	    foreach my $level (keys %{$self->{'levels'}}) {
+		next if $level =~ /paragraph/; # we don't do para indexing
+		my ($pindex) = $level =~ /^(.)/;
+		# should probably check that new name with level
+		# is unique ... but currently (with doc sec and para)
+		# each has unique first letter.
+		$self->{'index_mapping'}->{$index} = $pindex.$idx;
+
+		my $llevel = $mgppbuilder::level_map{$level};
+		print $outhandle "\n*** building index $index at level $llevel in subdirectory " .
+		    "$self->{'index_mapping'}->{$index}\n" if ($self->{'verbosity'} >= 1);
+		print STDERR "<Stage name='Index' source='$index' level=$llevel>\n" if $self->{'gli'};
+
+		$self->build_index($index,$llevel);
+	    }
+	    $self->{'index_mapping'}->{$index} = $idx;
+
+	} else {
+	    print $outhandle "\n*** ignoring index $index\n" if ($self->{'verbosity'} >= 1);
+	}
     }
 
@@ -240,5 +240,5 @@
 #  */
 sub remove_document_from_database
-  {
+{
     my ($self, $oid) = @_;
     # Find the perl script to call to run lucene
@@ -246,5 +246,5 @@
     # Call lucene_passes.pl with -remove and the document ID on the command line
     `$full_lucene_passes_exe -remove "$oid"`;
-  }
+}
 # /** remove_document_from_database **/
 
@@ -275,10 +275,10 @@
     my $osextra = "";
     if ($ENV{'GSDLOS'} =~ /^windows$/i) {
-    $build_dir =~ s@/@\\@g;
+	$build_dir =~ s@/@\\@g;
     } else {
-    if ($outhandle ne "STDERR") {
-        # so lucene_passes doesn't print to stderr if we redirect output
-        $osextra .= " 2>/dev/null";
-    }
+	if ($outhandle ne "STDERR") {
+	    # so lucene_passes doesn't print to stderr if we redirect output
+	    $osextra .= " 2>/dev/null";
+	}
     }
 
@@ -294,7 +294,7 @@
 
     foreach $subcollection (@subcollections) {
-    if (defined ($self->{'collect_cfg'}->{'subcollection'}->{$subcollection})) {
-        push (@$indexexparr, $self->{'collect_cfg'}->{'subcollection'}->{$subcollection});
-    }
+	if (defined ($self->{'collect_cfg'}->{'subcollection'}->{$subcollection})) {
+	    push (@$indexexparr, $self->{'collect_cfg'}->{'subcollection'}->{$subcollection});
+	}
     }
 
@@ -305,17 +305,17 @@
     my $language_metadata = "Language";
     if (defined ($self->{'collect_cfg'}->{'language_metadata'})) {
-    $language_metadata = $self->{'collect_cfg'}->{'language_metadata'};
+	$language_metadata = $self->{'collect_cfg'}->{'language_metadata'};
     }
     @languages = split /,/, $language if (defined $language);
     foreach my $language (@languages) {
-    my $not=0;
-    if ($language =~ s/^\!//) {
-        $not = 1;
-    }
-    if($not) {
-        push (@$langarr, "!$language");
-    } else {
-        push (@$langarr, "$language");
-    }
+	my $not=0;
+	if ($language =~ s/^\!//) {
+	    $not = 1;
+	}
+	if($not) {
+	    push (@$langarr, "!$language");
+	} else {
+	    push (@$langarr, "$language");
+	}
     }
 
@@ -326,13 +326,13 @@
 
     if ($self->{'debug'}) {
-    $handle = STDOUT;
+	$handle = STDOUT;
     } else {
-      print STDERR "Cmd: $full_lucene_passes_exe $opt_create_index index $lucene_passes_sections \"$build_dir\" \"$indexdir\"   $osextra\n";
-    if (!-e "$full_lucene_passes" ||
-        !open (PIPEOUT, "| $full_lucene_passes_exe $opt_create_index index $lucene_passes_sections \"$build_dir\" \"$indexdir\"   $osextra")) {
-        print STDERR "<FatalError name='NoRunLucenePasses'/>\n</Stage>\n" if $self->{'gli'};
-        die "lucenebuilder::build_index - couldn't run $lucene_passes_exe\n";
-    }
-    $handle = lucenebuilder::PIPEOUT;
+	print STDERR "Cmd: $full_lucene_passes_exe $opt_create_index index $lucene_passes_sections \"$build_dir\" \"$indexdir\"   $osextra\n";
+	if (!-e "$full_lucene_passes" ||
+	    !open (PIPEOUT, "| $full_lucene_passes_exe $opt_create_index index $lucene_passes_sections \"$build_dir\" \"$indexdir\"   $osextra")) {
+	    print STDERR "<FatalError name='NoRunLucenePasses'/>\n</Stage>\n" if $self->{'gli'};
+	    die "lucenebuilder::build_index - couldn't run $lucene_passes_exe\n";
+	}
+	$handle = lucenebuilder::PIPEOUT;
     }
 
@@ -340,16 +340,16 @@
     my $gdbm_level = "document";
     if ($store_levels->{'section'}) {
-    $gdbm_level = "section";
+	$gdbm_level = "section";
     }
 
     my $dom_level = "";
     foreach my $key (keys %$store_levels) {
-    if ($mgppbuilder::level_map{$key} eq $llevel) {
-        $dom_level = $key;
-    }
+	if ($mgppbuilder::level_map{$key} eq $llevel) {
+	    $dom_level = $key;
+	}
     }
     if ($dom_level eq "") {
-    print STDERR "Warning: unrecognized tag level $llevel\n";
-    $dom_level = "document";
+	print STDERR "Warning: unrecognized tag level $llevel\n";
+	$dom_level = "document";
     }
 
@@ -367,5 +367,5 @@
     $self->{'buildproc'}->reset();
     &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
-           "", {}, $self->{'buildproc'}, $self->{'maxdocs'}, 0, $self->{'gli'});
+		   "", {}, $self->{'buildproc'}, $self->{'maxdocs'}, 0, $self->{'gli'});
     close ($handle) unless $self->{'debug'};
 
@@ -383,5 +383,5 @@
 #  */
 sub make_infodatabase
-  {
+{
     my $self = shift (@_);
     my $outhandle = $self->{'outhandle'};
@@ -397,5 +397,5 @@
     #       called once to generate it.
     if (!$self->{'incremental_dlc'} || !(-e $infodb_file))
-      {
+    {
         # basebuilder::make_infodatabase(@_);
         # Note: this doesn't work as the direct reference means all the $self
@@ -403,5 +403,5 @@
         $self->basebuilder::make_infodatabase(@_);
         return;
-      }
+    }
 
     # Carry on with an incremental addition
