Ignore:
Timestamp:
2012-05-10T21:32:52+12:00 (12 years ago)
Author:
ak19
Message:

Adding in the new activate.pl script to be called at the end of the build process. It moves building to index after first deactivating the collection on the server (if this is running and a persistent server). After the move operation, it then activates the collection on the server again, if the server is still running and is a persistent server.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/full-rebuild.pl

    r24747 r25573  
    3232# (assumming import.pl did not end with an error)
    3333
     34# The -keepold argument can be passed into this script since this calls activate.pl
     35# And activate.pl allows the contents of a src dir to be moved into the dest_dir
     36# without destroying other (uniquely-named) contents of dest_dir.
    3437
    3538BEGIN {
     
    4346
    4447
     48# This subroutine has been replaced by a call to activate.pl in sub main
    4549sub full_replace
    4650{
     
    119123    my @import_argv = ();
    120124    my @buildcol_argv = ();
     125    my @activate_argv = ();
    121126
    122127    my $site        = undef;
     
    130135        push(@import_argv,$arg,$site);
    131136        push(@buildcol_argv,$arg,$site);
     137        push(@activate_argv,$arg,$site);
    132138    }
    133139    elsif ($arg eq "-collectdir") {
     
    135141        push(@import_argv,$arg,$collect_dir);
    136142        push(@buildcol_argv,$arg,$collect_dir);
     143        push(@activate_argv,$arg,$collect_dir);
    137144    }
    138145    elsif ($arg eq "-importdir") {
     
    142149    }
    143150    elsif ($arg eq "-builddir") {
    144         # only makes sense in buildcol.pl
     151        # only makes sense in buildcol.pl and activate.pl
    145152        $build_dir = shift @argv;
    146153        push(@buildcol_argv,$arg,$build_dir);
     154        push(@activate_argv,$arg,$build_dir);
    147155    }
    148156    elsif ($arg eq "-indexdir") {
    149         # only makes sense in buildcol.pl
     157        # only makes sense in buildcol.pl and activate.pl
    150158        $index_dir = shift @argv;
    151159        push(@buildcol_argv,$arg,$index_dir);
     160        push(@activate_argv,$arg,$index_dir);
    152161    }
    153162    else {
    154163        push(@import_argv,$arg);
    155164        push(@buildcol_argv,$arg);
     165        push(@activate_argv,$arg);
    156166    }
    157167    }
     
    160170    my $quoted_import_argv = join(" ", map { "\"$_\"" } @import_argv);
    161171    my $quoted_buildcol_argv = join(" ", map { "\"$_\"" } @buildcol_argv);
     172    my $quoted_activate_argv = join(" ", map { "\"$_\"" } @activate_argv);
    162173   
    163174    my $final_status = 0;
     
    186197    if ($buildcol_status == 0) {
    187198
    188         full_replace($site,$collect_dir,$collect,$build_dir,$index_dir);
     199        #full_replace($site,$collect_dir,$collect,$build_dir,$index_dir);
     200        my $activatecol_cmd = $launch_cmd . "activate.pl $quoted_activate_argv \"$collect\"";
     201        my $activatecol_status = system($activatecol_cmd)/256;
    189202    }
    190203    else {
Note: See TracChangeset for help on using the changeset viewer.