Index: /gsdl/trunk/bin/script/buildcol.pl
===================================================================
--- /gsdl/trunk/bin/script/buildcol.pl	(revision 20570)
+++ /gsdl/trunk/bin/script/buildcol.pl	(revision 20571)
@@ -31,4 +31,5 @@
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
+    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/perl-5.8");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/XML/XPath");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugins");
@@ -274,5 +275,6 @@
     # command line args
     my ($verbosity, $archivedir, $cachedir, $builddir, $site, $maxdocs, 
-	$debug, $mode, $indexname, $removeold, $keepold, $incremental, 
+	$debug, $mode, $indexname, $removeold, $keepold, 
+	$incremental, $incremental_mode,
 	$remove_empty_classifications,
 	$collectdir, $build, $type, $textindex,
@@ -445,5 +447,8 @@
     }
     
-    ($removeold, $keepold, $incremental) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, $incremental, "building", $collectcfg);
+    ($removeold, $keepold, $incremental, $incremental_mode) 
+	= &scriptutil::check_removeold_and_keepold($removeold, $keepold, 
+						   $incremental, "building", 
+						   $collectcfg);
  
     $gli = 0 unless defined $gli;
Index: /gsdl/trunk/bin/script/export.pl
===================================================================
--- /gsdl/trunk/bin/script/export.pl	(revision 20570)
+++ /gsdl/trunk/bin/script/export.pl	(revision 20571)
@@ -276,5 +276,5 @@
     my ($language, $verbosity, $debug,
 	$collectdir, $importdir, $exportdir, $site, $manifest, 
-	$incremental, $keepold, $removeold,
+	$incremental, $incremental_mode, $keepold, $removeold,
 	$saveas,
 	$OIDtype, $OIDmetadata,
@@ -450,5 +450,8 @@
 
     # check keepold and removeold
-    ($removeold, $keepold, $incremental) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, $incremental, "export", $collectcfg);
+    ($removeold, $keepold, $incremental, $incremental_mode) 
+	= &scriptutil::check_removeold_and_keepold($removeold, $keepold, 
+						   $incremental, "export", 
+						   $collectcfg);
 
     print STDERR "<export>\n" if $gli;
@@ -469,5 +472,5 @@
     
     # load all the plugins
-    $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts);
+    $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts, $incremental_mode);
 	    
     if (scalar(@$pluginfo) == 0) {
@@ -579,8 +582,23 @@
     $processor->close_group_output() if $processor->is_group();
 
-    if (($saveas =~ m/^.*METS$/) || ($saveas eq "MARCXML")) {
-	# Not all export types need this (e.g. DSpace)
+#    if (($saveas =~ m/^.*METS$/) || ($saveas eq "MARCXML")) {
+#	# Not all export types need this,
+
+##	$export_info->save_info($expinfo_doc_filename);
+#    }
+
+    my $expinfo_src_filename = &util::filename_cat ($exportdir, "archiveinf-src");   
+    &util::rename_gdbm_file($expinfo_src_filename); # ensures gdb
+    $expinfo_src_filename .= ".gdb";
+
+
+    # for backwards compatability with archvies.inf file
+    if ($expinfo_doc_filename =~ m/(contents)|(\.inf)$/) {
 	$export_info->save_info($expinfo_doc_filename);
     }
+    else {
+	$export_info->save_revinfo_gdbm($expinfo_src_filename);
+    }
+
 	    
     # write out export stats
Index: /gsdl/trunk/bin/script/import.pl
===================================================================
--- /gsdl/trunk/bin/script/import.pl	(revision 20570)
+++ /gsdl/trunk/bin/script/import.pl	(revision 20571)
@@ -36,4 +36,5 @@
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
+    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/perl-5.8");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugins");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugouts");
@@ -278,5 +279,5 @@
     my ($language, $verbosity, $debug,
 	$collectdir, $importdir, $archivedir, $site, $manifest, 
-	$incremental, $keepold, $removeold, 
+	$incremental, $incremental_mode, $keepold, $removeold, 
 	$saveas,
 	$OIDtype, $OIDmetadata, 
@@ -480,5 +481,8 @@
        
     # check keepold and removeold
-    ($removeold, $keepold, $incremental) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, $incremental, "archives", $collectcfg);
+    ($removeold, $keepold, $incremental, $incremental_mode) 
+	= &scriptutil::check_removeold_and_keepold($removeold, $keepold, 
+						   $incremental, "archives", 
+						   $collectcfg);
  
 
@@ -501,5 +505,5 @@
 
     # load all the plugins
-    $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts, $incremental);
+    $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts, $incremental_mode);
     if (scalar(@$pluginfo) == 0) {
 	&gsprintf($out, "{import.no_plugins_loaded}\n");
@@ -585,5 +589,6 @@
 
 
-	if (!$removeold) {
+	if ($incremental) {
+	    # equivalent to saying ($keepold && ($incremental_mode eq "all"))
 
 	    &inexport::prime_doc_oid_count($archivedir);
@@ -593,5 +598,6 @@
 	    # been deleted
 	    
-	    &inexport::new_vs_old_import_diff($archive_info,$block_hash,$importdir);
+	    &inexport::new_vs_old_import_diff($archive_info,$block_hash,$importdir,
+					      $archivedir,$verbosity,$incremental_mode);
 	    
 	    my @deleted_files = sort keys %{$block_hash->{'deleted_files'}};
@@ -639,5 +645,5 @@
 
 
-	    # not sure if the following will work -- wil the metadata datastructure be correctly initialized
+	    # not sure if the following will work -- will the metadata data-structure be correctly initialized
 	    # in the right order?
 #	    foreach my $file (@new_files, @reindex_files) {
@@ -688,5 +694,5 @@
 
     # for backwards compatability with archvies.inf file
-    if ($arcinfo_doc_filename =~ m/\.inf$/) {
+    if ($arcinfo_doc_filename =~ m/(contents)|(\.inf)$/) {
 	$archive_info->save_info($arcinfo_doc_filename);
     }
Index: /gsdl/trunk/bin/script/incremental-import.pl
===================================================================
--- /gsdl/trunk/bin/script/incremental-import.pl	(revision 20570)
+++ /gsdl/trunk/bin/script/incremental-import.pl	(revision 20571)
@@ -120,5 +120,4 @@
     }
     else {
-###	print STDERR "$archiveinf_doc does not exist.\n";
 	print STDERR "*****\n";
 	print STDERR "First time import. Switching to full import.pl.\n";
Index: /gsdl/trunk/bin/script/pluginfo.pl
===================================================================
--- /gsdl/trunk/bin/script/pluginfo.pl	(revision 20570)
+++ /gsdl/trunk/bin/script/pluginfo.pl	(revision 20571)
@@ -36,4 +36,5 @@
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
+    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/perl-5.8");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugins");
 
