Index: main/trunk/greenstone2/perllib/ClassifyTreeModel.pm
===================================================================
--- main/trunk/greenstone2/perllib/ClassifyTreeModel.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/ClassifyTreeModel.pm	(revision 23485)
@@ -157,5 +157,5 @@
     my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $self->getCollection(), "index", "text");
     my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'infodbtype'}, $self->getCollection(), $index_text_directory_path);
-    if (&dbutil::read_infodb_entry($self->{'infodbtype'}, $infodb_file_path, $clid) =~ /\w+/)
+    if (&dbutil::read_infodb_rawentry($self->{'infodbtype'}, $infodb_file_path, $clid) =~ /\w+/)
       {
         # Since the CLID can directly reference the correct entry in the info database we
Index: main/trunk/greenstone2/perllib/ClassifyTreeNode.pm
===================================================================
--- main/trunk/greenstone2/perllib/ClassifyTreeNode.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/ClassifyTreeNode.pm	(revision 23485)
@@ -62,5 +62,5 @@
     # Check if this node already exists in the database, and if not insert it
     # now
-    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     if($text !~ /\w+/ && $force_new)
       {
@@ -268,5 +268,5 @@
 
     # Now determine if this node exists.
-    if (&dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $next_clid) =~ /\w+/)
+    if (&dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $next_clid) =~ /\w+/)
       {
         # And if so, create it.
@@ -658,5 +658,5 @@
 
     # Load the text of this node
-    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
 
     # Replace the contains
@@ -686,5 +686,5 @@
 
     # Load the text of this node
-    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     # Replace the numleafdocs
     $text =~ s/<numleafdocs>\d*?\n+/<numleafdocs>$numleafdocs\n/;
@@ -713,5 +713,5 @@
 
     # Load the text of this node
-    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     # Replace the title
     $text =~ s/<Title>.*?\n+/<Title>$title\n/;
@@ -736,5 +736,5 @@
     my $clid = $self->{'clid'};
 
-    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
+    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $self->{'infodb_file_path'}, $clid);
     return $text;
   }
Index: main/trunk/greenstone2/perllib/IncrementalDocument.pm
===================================================================
--- main/trunk/greenstone2/perllib/IncrementalDocument.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/IncrementalDocument.pm	(revision 23485)
@@ -154,5 +154,5 @@
     my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text");
     my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'infodbtype'}, $collection, $index_text_directory_path);
-    my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $infodb_file_path, $self->{'oid'});
+    my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $infodb_file_path, $self->{'oid'});
     # For each line in the raw text, extract the key (enclosed in angle
     # brackets) and the value
@@ -203,5 +203,5 @@
     if($doc_num >= 0)
       {
-	my $text = &dbutil::read_infodb_entry($self->{'infodbtype'}, $infodb_file_path, $doc_num);
+	my $text = &dbutil::read_infodb_rawentry($self->{'infodbtype'}, $infodb_file_path, $doc_num);
 
         # If there is no reverse lookup, then add one now
Index: main/trunk/greenstone2/perllib/dbutil.pm
===================================================================
--- main/trunk/greenstone2/perllib/dbutil.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/dbutil.pm	(revision 23485)
@@ -214,4 +214,20 @@
     }
 }
+
+sub read_infodb_rawentry
+{
+  my $infodb_type = shift(@_);
+  my $infodb_file_path = shift(@_);
+  my $infodb_key = shift(@_);
+
+    
+  # !! TEMPORARY: Slow and naive implementation that just reads the entire file and picks out the one value
+  # !! This will soon be replaced with database-specific versions that will use dbget etc.
+  my $infodb_map = {};
+  &read_infodb_file($infodb_type, $infodb_file_path, $infodb_map);
+  
+  return $infodb_map->{$infodb_key}; 
+}
+
 
 sub read_infodb_entry
@@ -248,11 +264,7 @@
   
   
-  
-  # !! TEMPORARY: Slow and naive implementation that just reads the entire file and picks out the one value
-  # !! This will soon be replaced with database-specific versions that will use dbget etc.
-  my $infodb_map = {};
-  &read_infodb_file($infodb_type, $infodb_file_path, $infodb_map);
-  
-  my $infodb_rec = &dbutil::convert_infodb_string_to_hash($infodb_map->{$infodb_key}); 
+  # rawentry above is currently naive implementation
+  my $raw_string = read_infodb_rawentry($infodb_type, $infodb_file_path, $infodb_key);
+  my $infodb_rec = &dbutil::convert_infodb_string_to_hash($raw_string); 
   
   return $infodb_rec;
Index: main/trunk/greenstone2/perllib/doc.pm
===================================================================
--- main/trunk/greenstone2/perllib/doc.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/doc.pm	(revision 23485)
@@ -283,4 +283,9 @@
 	}
     }
+
+    if (!&util::filename_is_absolute($filename)) {
+	$filename = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},$filename);
+    }
+
     return $filename;
 }
@@ -410,5 +415,5 @@
 
 	if ($use_hash_oid) {
-	    my $hash_on_file = 1;
+	    my $hash_on_file = 0;
 	    if ($self->{'OIDtype'} eq "hash_on_ga_xml") {
 		$hash_on_file = 0;
Index: main/trunk/greenstone2/perllib/inexport.pm
===================================================================
--- main/trunk/greenstone2/perllib/inexport.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/inexport.pm	(revision 23485)
@@ -944,5 +944,5 @@
 		# is it modified??
 		if (-M $full_curr_file < $archiveinf_timestamp) {
-		    print STDERR "*** Detected a modified metadata file: $full_curr_file\n" if $verbosity > 2;
+		    print STDERR "*** Detected a *modified metadata* file: $full_curr_file\n" if $verbosity >= 2;
 		    # its newer than last build
 		    $block_hash->{'new_or_modified_metadata_files'}->{$full_curr_file} = 1;
@@ -974,5 +974,5 @@
 		# Greenstone to always be this)
 
-		print STDERR "***** Detected new metadata file: $full_curr_file\n" if $verbosity > 2;
+		print STDERR "*** Detected *new* metadata file: $full_curr_file\n" if $verbosity >= 2;
 		$block_hash->{'new_or_modified_metadata_files'}->{$full_curr_file} = 1;
 	    }
@@ -1012,4 +1012,7 @@
 	
 	    if ($existing_f =~ m/^$situated_dir/) {
+
+		print STDERR "**** Existing file $existing_f\nis located within\n$situated_dir\n";
+
 		push(@$reindex_files,$existing_f);
 		$block_hash->{'reindex_files'}->{$existing_f} = 1;
@@ -1107,6 +1110,5 @@
 	# that this file is used in (note in most cases, it's just one OID)
 	
-	my $src_rec_string = &dbutil::read_infodb_entry($infodbtype, $arcinfo_src_filename, $file);
-	my $src_rec = &dbutil::convert_infodb_string_to_hash($src_rec_string);
+	my $src_rec = &dbutil::read_infodb_entry($infodbtype, $arcinfo_src_filename, $file);
 	my $oids = $src_rec->{'oid'};
 	my $file_record_deleted = 0;
@@ -1121,6 +1123,5 @@
 
 	    # find the source doc (the primary file that becomes this oid)
-	    my $doc_rec_string = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
-	    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
+	    my $doc_rec = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
 	    my $doc_source_file = $doc_rec->{'src-file'}->[0];
 	    if (!&util::filename_is_absolute($doc_source_file)) {
@@ -1142,5 +1143,5 @@
 		# mark oid for deletion (it will be deleted or reimported)
 		$archive_info->set_status_info($oid,"D");
-		my $val = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
+		my $val = &dbutil::read_infodb_rawentry($infodbtype, $arcinfo_doc_filename, $oid);
 		$val =~ s/^<index-status>(.*)$/<index-status>D/m;
 
Index: main/trunk/greenstone2/perllib/manifest.pm
===================================================================
--- main/trunk/greenstone2/perllib/manifest.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/manifest.pm	(revision 23485)
@@ -185,7 +185,5 @@
 	    my $arcinfo_doc_filename = $self->{'_arcinfo-doc-filename'};
 	    
-	    my $doc_rec_string = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
-
-	    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string);
+	    my $doc_rec = &dbutil::read_infodb_entry($infodbtype, $arcinfo_doc_filename, $oid);
 	    
 	    my $doc_source_file = $doc_rec->{'src-file'}->[0];
Index: main/trunk/greenstone2/perllib/plugin.pm
===================================================================
--- main/trunk/greenstone2/perllib/plugin.pm	(revision 23484)
+++ main/trunk/greenstone2/perllib/plugin.pm	(revision 23485)
@@ -232,6 +232,5 @@
 	# that this file is used in (note in most cases, it's just one OID)
 	
-	my $src_rec_string = &dbutil::read_infodb_entry($infodbtype, $arcinfo_src_filename, $file);
-	my $src_rec = &dbutil::convert_infodb_string_to_hash($src_rec_string);
+	my $src_rec = &dbutil::read_infodb_entry($infodbtype, $arcinfo_src_filename, $file);
 	my $oids = $src_rec->{'oid'};
 	my $rv;
