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/buildcol.pl

    r25553 r25573  
    238238    'reqd' => "no",
    239239    'hiddengli' => "yes" },
     240      { 'name' => "activate",
     241    'desc' => "{buildcol.activate}",
     242    'type' => "flag",
     243    'reqd' => "no",
     244    'hiddengli' => "yes" },
    240245      ];
    241246
     
    301306    $no_strip_html, $store_metadata_coverage,
    302307    $no_text, $faillog, $gli, $index, $language,
    303     $sections_index_document_metadata, $maxnumeric);
    304 
     308    $sections_index_document_metadata, $maxnumeric, $activate);
     309   
    305310    my $xml = 0;
    306311    my $hashParsingResult = {};
     
    682687    }
    683688
     689    # if buildcol.pl was run with -activate, need to run activate.pl
     690    # now that building's complete 
     691    if($activate) {
     692   
     693        #my $quoted_argv = join(" ", map { "\"$_\"" } @ARGV);
     694       
     695        my @activate_argv = ();
     696        push(@activate_argv,"-collectdir","$collectdir") if($collectdir);
     697        push(@activate_argv,"-builddir","$builddir") if($builddir);
     698        push(@activate_argv,"-site","$site") if($site);
     699        push(@activate_argv,"-removeold") if($removeold);
     700        push(@activate_argv,"-keepold") if($keepold);
     701        my $quoted_argv = join(" ", map { "\"$_\"" } @activate_argv);
     702       
     703        my $activatecol_cmd = "\"".&util::get_perl_exec()."\" -S activate.pl $quoted_argv \"$collection\"";
     704       
     705        my $activatecol_status = system($activatecol_cmd)/256;
     706
     707        if ($activatecol_status != 0) {
     708            print STDERR "Error: Failed to run: $activatecol_cmd\n";
     709            print STDERR "       $!\n" if ($! ne "");
     710            exit(-1);
     711        }
     712    }
     713   
    684714    close OUT if $close_out;
    685715    close FAILLOG;
Note: See TracChangeset for help on using the changeset viewer.