Index: main/trunk/greenstone2/perllib/buildConfigxml.pm
===================================================================
--- main/trunk/greenstone2/perllib/buildConfigxml.pm	(revision 22484)
+++ main/trunk/greenstone2/perllib/buildConfigxml.pm	(revision 22485)
@@ -331,5 +331,8 @@
 
     
-    &write_line('COLCFG', ["<defaultIndex shortname=\"", $defaultindex, "\" />"]);
+    #$defaultindex = "ZZ" if (!$defaultindex); # index allfields by default
+    if($defaultindex) {
+	&write_line('COLCFG', ["<defaultIndex shortname=\"", $defaultindex, "\" />"]);
+    }
 
 
Index: main/trunk/greenstone2/perllib/collConfigxml.pm
===================================================================
--- main/trunk/greenstone2/perllib/collConfigxml.pm	(revision 22484)
+++ main/trunk/greenstone2/perllib/collConfigxml.pm	(revision 22485)
@@ -152,5 +152,5 @@
     }
 
-    &Display; 
+    #&Display; 
     return $data;
 }
Index: main/trunk/greenstone2/perllib/dbutil.pm
===================================================================
--- main/trunk/greenstone2/perllib/dbutil.pm	(revision 22484)
+++ main/trunk/greenstone2/perllib/dbutil.pm	(revision 22485)
@@ -144,4 +144,9 @@
 }
 
+# This function, conceptually, would be better structured if it didn't
+# use return statements, as the database methods it calls do not
+# themselves return anything.
+# Note: if doing this, then the GDBM lines of code should be moved into
+# an 'else' clause
 
 sub read_infodb_file
@@ -177,4 +182,36 @@
 }
 
+sub read_infodb_keys
+{
+    my $infodb_type = shift(@_);
+    my $infodb_file_path = shift(@_);
+    my $infodb_map = shift(@_);
+    
+    if ($infodb_type eq "sqlite")
+    {
+	require dbutil::sqlite;
+	&dbutil::sqlite::read_infodb_keys($infodb_file_path, $infodb_map, @_);
+    }
+    elsif ($infodb_type eq "gdbm-txtgz")
+    {
+	require dbutil::gdbmtxtgz;
+	&dbutil::gdbmtxtgz::read_infodb_keys($infodb_file_path, $infodb_map, @_);
+    }
+    elsif ($infodb_type eq "jdbm")
+    {
+	require dbutil::jdbm;
+	&dbutil::jdbm::read_infodb_keys($infodb_file_path, $infodb_map, @_);
+    }
+    elsif ($infodb_type eq "mssql")
+    {
+	require dbutil::mssql;
+	&dbutil::mssql::read_infodb_keys($infodb_file_path, $infodb_map, @_);
+    }
+    else {
+	# Use GDBM if the infodb type is empty or not one of the values above
+	require dbutil::gdbm;
+	&dbutil::gdbm::read_infodb_keys($infodb_file_path, $infodb_map, @_);
+    }
+}
 
 sub read_infodb_entry
Index: main/trunk/greenstone2/perllib/dbutil/gdbmtxtgz.pm
===================================================================
--- main/trunk/greenstone2/perllib/dbutil/gdbmtxtgz.pm	(revision 22484)
+++ main/trunk/greenstone2/perllib/dbutil/gdbmtxtgz.pm	(revision 22485)
@@ -114,4 +114,33 @@
 }
 
+
+sub read_infodb_keys
+{
+  my $infodb_file_path = shift(@_);
+  my $infodb_map = shift(@_);
+
+  my $cmd = "gzip --decompress \"$infodb_file_path\"";
+
+  open (PIPEIN, "$cmd |") 
+  || die "Error: Couldn't open pipe from gzip: $!\n  $cmd\n";
+
+  my $infodb_line = "";
+  my $infodb_key = "";
+  while (defined ($infodb_line = <PIPEIN>))
+  {
+    if ($infodb_line =~ /^\[([^\]]+)\]$/)
+    {
+      $infodb_key = $1;
+    }
+    elsif ($infodb_line =~ /^-{70}$/)
+    {
+      $infodb_map->{$infodb_key} = 1;
+      $infodb_key = "";
+    }
+  }
+
+  close (PIPEIN);
+}
+
     
 sub write_infodb_entry
Index: main/trunk/greenstone2/perllib/dbutil/mssql.pm
===================================================================
--- main/trunk/greenstone2/perllib/dbutil/mssql.pm	(revision 22484)
+++ main/trunk/greenstone2/perllib/dbutil/mssql.pm	(revision 22485)
@@ -141,4 +141,13 @@
 
   print STDERR "******* mssql::read_infodb_file() TO BE IMPLEMENTED!\n";
+  print STDERR "******* See sqlite.pm for comparable implementation that has been coded up!\n";
+}
+
+sub read_infodb_keys
+{
+  my $infodb_file_path = shift(@_);
+  my $infodb_map = shift(@_);
+
+  print STDERR "******* mssql::read_infodb_keys() TO BE IMPLEMENTED!\n";
   print STDERR "******* See sqlite.pm for comparable implementation that has been coded up!\n";
 }
Index: main/trunk/greenstone2/perllib/dbutil/sqlite.pm
===================================================================
--- main/trunk/greenstone2/perllib/dbutil/sqlite.pm	(revision 22484)
+++ main/trunk/greenstone2/perllib/dbutil/sqlite.pm	(revision 22485)
@@ -141,4 +141,21 @@
   }
 
+}
+
+
+sub read_infodb_keys
+{
+  my $infodb_file_path = shift(@_);
+  my $infodb_map = shift(@_);
+
+
+  my $keys_str = read_infodb_cmd($infodb_file_path,"SELECT key FROM data;");
+
+  my @keys = split(/\n/,$keys_str);
+
+  foreach my $key (@keys)
+  {
+      $infodb_map->{$key} = 1;
+  }
 }
 
