Index: other-projects/nightly-tasks/diffcol/trunk/task.pl
===================================================================
--- other-projects/nightly-tasks/diffcol/trunk/task.pl	(revision 28071)
+++ other-projects/nightly-tasks/diffcol/trunk/task.pl	(revision 28072)
@@ -38,5 +38,12 @@
 my $setup_script = "setup"; # needs to become gs3-setup for GS3
 my $use_blat = 0; # if we ever get blat to send mail/attachments on Windows working, set this to 1
-my $use_static_model = 0; # set to 1 (true) if working with a non-svn model-collection
+
+my $use_local_rebuild = 0; # set to 1 (true) if we needn't copy model-collection over to the test collection again nor rebuild it (This is useful when having built the collection locally once before)
+my $use_static_model = 0; # set to 1 (true) if working with a non-svn model-collection. Defaults to 1 if $use_local_rebuild is turned on
+
+# if use_local_rebuild is on, use_static_model should be on
+if ($use_local_rebuild && !$use_static_model) {
+	$use_static_model = 1;
+}
 
 
@@ -421,10 +428,13 @@
     # perform the requested subcommands, outputting xml information
     print $xml_fh "<test time=\"$dateid\" id=\"$dateid\">\n";
-    
+	
+	my $cmd;
     # make sure that diffcol/model-collect is up to date before copying it over to greenstone-home
-
-    print $xml_fh "Updating $ENV{'TASK_HOME'}/model-collect:\n";
-    my $cmd = "svn up $ENV{'TASK_HOME'}/model-collect"; #chdir("$ENV{'TASK_HOME'}/model-collect");
-    my $status = system "$cmd";
+	
+	if(!$use_local_rebuild) {	
+		print $xml_fh "Updating $ENV{'TASK_HOME'}/model-collect:\n";
+		$cmd = "svn up $ENV{'TASK_HOME'}/model-collect"; #chdir("$ENV{'TASK_HOME'}/model-collect");
+		my $status = system "$cmd";
+	}
 
     # go to whichever greenstone_home we're using
@@ -444,28 +454,30 @@
     #copy the model collections to the collect folder to be rebuilt
     print STDERR "installing test collections and model collections to new $gsdl installation... ";
-	
-    #clean up
-    if(-d "collect") {
-	&File::Path::remove_tree("collect") || die "Error could not delete collect: $!";
-    }
-
-    if($use_static_model) {	    
-	#copy to collect and strip .svn subfolders
-	&File::Path::make_path("collect"); # create the collect folder and copy contents from static model-collection across
-	&copy_recursively("model-collect", "collect", ".svn");
-
-    } else { # the default situation: where we check out the model-collect from svn
-	&File::Path::remove_tree("model-collect");
-	
-	#copy to collect and strip .svn subfolders
-	&File::Path::make_path("collect"); # create the folder and copy contents across
-	&copy_recursively(&filename_concat("$ENV{'TASK_HOME'}","model-collect"), "collect", ".svn");
-	
-	#make the model copy
-	&File::Path::make_path("model-collect"); 
-	&copy_recursively("collect", "model-collect"); # copy contents across
-    }
-    print STDERR "done\n";    
-	
+
+	if(!$use_local_rebuild) {	
+		#clean up
+		if(-d "collect") {
+		&File::Path::remove_tree("collect") || die "Error could not delete collect: $!";
+		}
+
+		if($use_static_model) {	    
+		#copy to collect and strip .svn subfolders
+		&File::Path::make_path("collect"); # create the collect folder and copy contents from static model-collection across
+		&copy_recursively("model-collect", "collect", ".svn");
+
+		} else { # the default situation: where we check out the model-collect from svn
+		&File::Path::remove_tree("model-collect");
+		
+		#copy to collect and strip .svn subfolders
+		&File::Path::make_path("collect"); # create the folder and copy contents across
+		&copy_recursively(&filename_concat("$ENV{'TASK_HOME'}","model-collect"), "collect", ".svn");
+		
+		#make the model copy
+		&File::Path::make_path("model-collect"); 
+		&copy_recursively("collect", "model-collect"); # copy contents across
+		}
+
+		print STDERR "done\n";
+	}	
 
     #for each collection, import, build and diff with its model counterpart
@@ -484,31 +496,32 @@
 	print $xml_fh "<collection-test name=\"$collection\">\n";
 
-	#import
-# Ensure the OIDtype for importing is hash_on_full_filename
-# "to make document identifiers more stable across upgrades of the software, 
-# although it means that duplicate documents contained in the collection are
-# no longer detected automatically."
-	print STDERR "$collection - Importing:\n";
-	print $xml_fh "<import>\n";
-	&run_build_script("import.pl -removeold $collection"); #-OIDtype hash_on_full_filename
-	print $xml_fh "</import>\n";
-	print STDERR "done\n";	
-
-	#build
-	print STDERR "$collection - Building:\n";
-	print $xml_fh "<build>\n";
-	&run_build_script("buildcol.pl -removeold $collection");
-	print $xml_fh "</build>\n";
-	print STDERR "done\n";
-	
-	#rename the intermediate 'building' directory 'index'
-	print STDERR "$collection - Move \"building\" to \"index\"... ";
-	my $index = &filename_concat("collect", $collection, "index");
-	my $building = &filename_concat("collect", $collection, "building");
-	&File::Path::remove_tree($index);
-	# Renaming Directories, http://www.perlmonks.org/?node_id=177421
-	move($building, $index) or die "copy failed: $!"; # File::Copy::move
-	print STDERR "done\n";
-
+	if(!$use_local_rebuild) {		
+		#import
+	# Ensure the OIDtype for importing is hash_on_full_filename
+	# "to make document identifiers more stable across upgrades of the software, 
+	# although it means that duplicate documents contained in the collection are
+	# no longer detected automatically."
+		print STDERR "$collection - Importing:\n";
+		print $xml_fh "<import>\n";
+		&run_build_script("import.pl -removeold $collection"); #-OIDtype hash_on_full_filename
+		print $xml_fh "</import>\n";
+		print STDERR "done\n";	
+
+		#build
+		print STDERR "$collection - Building:\n";
+		print $xml_fh "<build>\n";
+		&run_build_script("buildcol.pl -removeold $collection");
+		print $xml_fh "</build>\n";
+		print STDERR "done\n";
+		
+		#rename the intermediate 'building' directory 'index'
+		print STDERR "$collection - Move \"building\" to \"index\"... ";
+		my $index = &filename_concat("collect", $collection, "index");
+		my $building = &filename_concat("collect", $collection, "building");
+		&File::Path::remove_tree($index);
+		# Renaming Directories, http://www.perlmonks.org/?node_id=177421
+		move($building, $index) or die "copy failed: $!"; # File::Copy::move
+		print STDERR "done\n";
+	}
 	#diffcol
 	print STDERR "$collection - Diffing:\n";
