Index: /gsdl/trunk/bin/script/import.pl
===================================================================
--- /gsdl/trunk/bin/script/import.pl	(revision 20684)
+++ /gsdl/trunk/bin/script/import.pl	(revision 20685)
@@ -39,5 +39,4 @@
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugins");
     unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugouts");
-    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/classify");
 
     if (defined $ENV{'GSDLEXTS'}) {
@@ -50,5 +49,4 @@
 	    unshift (@INC, "$ext_prefix/perllib/plugins");
 	    unshift (@INC, "$ext_prefix/perllib/plugouts");
-	    unshift (@INC, "$ext_prefix/perllib/classify");
 	}
     }
@@ -198,5 +196,5 @@
 	'desc' => "{import.OIDmetadata}",
 	'type' => "string",
-	# 'type' => "metadata", #doesn't work properly in GLI
+	 #'type' => "metadata", #doesn't work properly in GLI
 	# parsearg left "" as default
 	#'deft' => "dc.Identifier",
@@ -589,6 +587,5 @@
 
 
-	if ($incremental) {
-	    # equivalent to saying ($keepold && ($incremental_mode eq "all"))
+	if ($incremental || $incremental_mode eq "onlyadd") {
 
 	    &inexport::prime_doc_oid_count($archivedir);
@@ -601,28 +598,4 @@
 					      $archivedir,$verbosity,$incremental_mode);
 	    
-	    my @deleted_files = sort keys %{$block_hash->{'deleted_files'}};
-	    # Filter out any in gsdl/tmp area
-	    my @filtered_deleted_files = ();
-	    my $gsdl_tmp_area = &util::filename_cat($ENV{'GSDLHOME'}, "tmp");
-	    my $collect_tmp_area = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "tmp");
-	    $gsdl_tmp_area = &util::filename_to_regex($gsdl_tmp_area);
-	    $collect_tmp_area = &util::filename_to_regex($collect_tmp_area);
-
-
-	    foreach my $df (@deleted_files) {
-		next if ($df =~ m/^$gsdl_tmp_area/);
-		next if ($df =~ m/^$collect_tmp_area/);
-		
-		push(@filtered_deleted_files,$df);
-	    }
-
-	    
-	    @deleted_files = @filtered_deleted_files;
-
-	    if (scalar(@deleted_files>0)) {
-		print STDERR "Files deleted since last import:\n  ";
-		print STDERR join("\n  ",@deleted_files), "\n";
-	    }
-	    
 	    my @new_files = sort keys %{$block_hash->{'new_files'}};
 	    if (scalar(@new_files>0)) {
@@ -630,26 +603,54 @@
 		print STDERR join("\n  ",@new_files), "\n";
 	    }
-	    
-	    &inexport::mark_docs_for_deletion($archive_info,$block_hash,\@deleted_files,
-					      $archivedir,$verbosity);
-
-	    &inexport::mark_docs_for_reindex($archive_info,$block_hash,
-					     $archivedir,$verbosity);
-
-	    my @reindex_files = sort keys %{$block_hash->{'reindex_files'}};
-
-	    if (scalar(@reindex_files>0)) {
-		print STDERR "Files to reindex since last import:\n  ";
-		print STDERR join("\n  ",@reindex_files), "\n";
-	    }
-
-
-	    # not sure if the following will work -- will the metadata data-structure be correctly initialized
-	    # in the right order?
+
+	    if ($incremental) {
+               # only look for deletions if we are truely incremental
+		my @deleted_files = sort keys %{$block_hash->{'deleted_files'}};
+		# Filter out any in gsdl/tmp area
+		my @filtered_deleted_files = ();
+		my $gsdl_tmp_area = &util::filename_cat($ENV{'GSDLHOME'}, "tmp");
+		my $collect_tmp_area = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "tmp");
+		$gsdl_tmp_area = &util::filename_to_regex($gsdl_tmp_area);
+		$collect_tmp_area = &util::filename_to_regex($collect_tmp_area);
+		
+		
+		foreach my $df (@deleted_files) {
+		    next if ($df =~ m/^$gsdl_tmp_area/);
+		    next if ($df =~ m/^$collect_tmp_area/);
+		    
+		    push(@filtered_deleted_files,$df);
+		}
+		
+		
+		@deleted_files = @filtered_deleted_files;
+		
+		if (scalar(@deleted_files>0)) {
+		    print STDERR "Files deleted since last import:\n  ";
+		    print STDERR join("\n  ",@deleted_files), "\n";
+		}
+		
+		
+		&inexport::mark_docs_for_deletion($archive_info,$block_hash,\@deleted_files,
+						  $archivedir,$verbosity);
+		
+		&inexport::mark_docs_for_reindex($archive_info,$block_hash,
+						 $archivedir,$verbosity);
+		
+		my @reindex_files = sort keys %{$block_hash->{'reindex_files'}};
+		
+		if (scalar(@reindex_files>0)) {
+		    print STDERR "Files to reindex since last import:\n  ";
+		    print STDERR join("\n  ",@reindex_files), "\n";
+		}
+		
+		
+		# 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) {
 #		&plugin::read ($pluginfo, $importdir, $file, $block_hash, $metadata, $processor, $maxdocs, 0, $gli);
 #	    }
-
-
+		
+	    }
+	    
 	    # Play it safe, and run through the entire folder, only processing new or edited files
 	    &plugin::read ($pluginfo, $importdir, "", $block_hash, $metadata, $processor, $maxdocs, 0, $gli);
