Index: /main/trunk/greenstone2/bin/script/full-rebuild.pl
===================================================================
--- /main/trunk/greenstone2/bin/script/full-rebuild.pl	(revision 29107)
+++ /main/trunk/greenstone2/bin/script/full-rebuild.pl	(revision 29108)
@@ -28,7 +28,8 @@
 
 # This program will rebuild a collection from scratch
-# Runs:        full-import.pl -removeold ...
-# Followed by: full-buildcol.pl -removeold ...
-# (assumming import.pl did not end with an error)
+# Runs:        full-import.pl -removeold [args]
+# Followed by: full-buildcol.pl -removeold [args]
+# Followed by: activate.pl -removeold [args]
+# (assumming import.pl/buildcol.pl did not end with an error)
 
 BEGIN {
@@ -41,58 +42,4 @@
 use util;
 
-
-# This subroutine has been replaced by a call to activate.pl in sub main
-sub full_replace
-{
-    my ($site,$collect_dir,$collect,$build_dir,$index_dir) = @_;
-
-
-    if (!defined $build_dir) {
-	if (defined $collect_dir) {
-	    $build_dir = &util::filename_cat($collect_dir,$collect, "building");
-	}
-	else {
-	    if (defined $site) {
-		$build_dir = &util::filename_cat($ENV{'GSDL3HOME'},"sites",$site,"collect",$collect, "building");
-	    }
-	    else {
-		$build_dir = &util::filename_cat($ENV{'GSDLHOME'},"collect",$collect, "building");
-	    }
-	}
-    }
-    
-    if (!defined $index_dir) {
-	if (defined $collect_dir) {
-	    $index_dir = &util::filename_cat($collect_dir,$collect, "index");
-	}
-	else {
-	    if (defined $site) {
-		$index_dir = &util::filename_cat($ENV{'GSDL3HOME'},"sites",$site,"collect",$collect, "index");
-	    }
-	    else {
-		$index_dir = &util::filename_cat($ENV{'GSDLHOME'},"collect",$collect, "index");
-	    }
-	}
-    }
-    
-    if (-e $index_dir) {
-	print "\n";
-	print "************************\n";
-	print "* Removing \"index\"\n";
-	print "************************\n";
-
-	# An improvement would be to check on error status
-	&util::rm_r($index_dir);
-    }
-    
-    print "\n";
-    print "************************\n";
-    print "* Moving \"building\" -> \"index\"\n";
-    print "************************\n";
-    
-    # An improvement would be to check on error status
-    &util::mv($build_dir,$index_dir);    
-}
-
 sub main
 {
@@ -103,27 +50,23 @@
 
 	print STDERR "\n";
-	print STDERR "This program runs import.pl followed by buildcol.pl (in both cases removing any previously\n";
-	print STDERR "  generated files in 'archives' or 'building'), and then replaces the content of collection's\n";
-	print STDERR "  'index' directory with 'building'.\n";
+	print STDERR "This program runs full-import.pl, full-buildcol.pl, activate.pl (in each case removing any previously generated files in 'archives', 'building','index')\n";
 	print STDERR "\n";
 	print STDERR "Usage: $progname [options]| collection\n";
+	print STDERR "\n";
 	print STDERR "       If a minus option is shared between import.pl and buildcol.pl then it can appear\n";
         print STDERR "         as is, such as -verbosity 5.  This value will be passed to both programs.\n";
 	print STDERR "       If a minus option is specific to one of the programs in particular, then prefix\n";
-	print STDERR "         it with 'import:' or 'buildcol:' respectively, as in '-import:OIDtype hash_on_full_filename'\n";
-	print STDERR "       Run 'import.pl' or 'buildcol.pl' from the command line with no arguments to see the\n";
-        print STDERR "         specific values they take.\n";
+	print STDERR "         it with 'import:', 'buildcol:', or 'activate:' respectively, \n";
+	print STDERR "         as in '-import:OIDtype hash_on_full_filename'\n";
+	print STDERR "       Run '(full-)import.pl -h', '(full-)buildcol.pl -h', 'activate.pl -h' from the \n";
+	print STDERR "         command line to see the specific values they take.\n";
 	print STDERR "\n";
 
 	exit(-1);
     }
-	
-
-    my $collect = pop @argv;
-
 
     my @import_argv = ();
     my @buildcol_argv = ();
-	my @activate_argv = ();
+    my @activate_argv = ();
 
     my $site        = undef;
@@ -190,13 +133,12 @@
 	}
     }
-
     
     my $quoted_import_argv = join(" ", map { "\"$_\"" } @import_argv);
     my $quoted_buildcol_argv = join(" ", map { "\"$_\"" } @buildcol_argv);
-	my $quoted_activate_argv = join(" ", map { "\"$_\"" } @activate_argv);
+    my $quoted_activate_argv = join(" ", map { "\"$_\"" } @activate_argv);
     
     my $final_status = 0;
 
-	# need to ensure that the path to perl is quoted (in case there's spaces in it)
+    # need to ensure that the path to perl is quoted (in case there's spaces in it)
     my $launch_cmd = "\"".&util::get_perl_exec()."\" -S ";    
     
@@ -206,5 +148,5 @@
     print "************************\n";
 
-    my $import_cmd = $launch_cmd . "full-import.pl $quoted_import_argv \"$collect\"";
+    my $import_cmd = $launch_cmd . "full-import.pl $quoted_import_argv";
 
     my $import_status = system($import_cmd)/256;
@@ -216,14 +158,12 @@
 	print "************************\n";
 	
-	my $buildcol_cmd = $launch_cmd . "full-buildcol.pl $quoted_buildcol_argv \"$collect\"";
+	my $buildcol_cmd = $launch_cmd . "full-buildcol.pl $quoted_buildcol_argv";
 	my $buildcol_status = system($buildcol_cmd)/256;
 
 	if ($buildcol_status == 0) {
 
-	    #full_replace($site,$collect_dir,$collect,$build_dir,$index_dir);
-		
-		# run activate with -removeold, just like full-buildcol.pl called above runs buildcol.pl
-		my $activatecol_cmd = $launch_cmd . "activate.pl -removeold $quoted_activate_argv \"$collect\"";
-		my $activatecol_status = system($activatecol_cmd)/256;
+	    # run activate with -removeold, just like full-buildcol.pl called above runs buildcol.pl
+	    my $activatecol_cmd = $launch_cmd . "activate.pl -removeold $quoted_activate_argv";
+	    my $activatecol_status = system($activatecol_cmd)/256;
 	}
 	else {
