Changeset 31753


Ignore:
Timestamp:
06/26/17 16:01:43 (4 years ago)
Author:
ak19
Message:

Two fixes Kathy requested: 1. when running buildcol, ONLY deactivate a collection surrounding the lock-sensitive make_infodatabase() calls IF incremental. 2. Allow buildcol.pl to accept activate parameters like library_url (library_name and skipactivation). full-(re)build and incremental-(re)build scripts already accept additional parameters such as with -activate:skipactivation, but buildcol.pl doesn't work that way.

Location:
main/trunk/greenstone2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/buildcol.pl

    r28801 r31753  
    256256    'reqd' => "no",
    257257    'hiddengli' => "yes" },
    258       { 'name' => "activate",
     258      { 'name' => "activate",
    259259    'desc' => "{buildcol.activate}",
    260260    'type' => "flag",
     261    'reqd' => "no",
     262    'hiddengli' => "yes" },
     263      { 'name' => "skipactivation",
     264    'desc' => "{buildcol.skipactivation}",
     265    'type' => "flag",
     266    'reqd' => "no",
     267    'hiddengli' => "yes" },
     268      { 'name' => "library_url",
     269    'desc' => "{buildcol.library_url}",
     270    'type' => "string",
     271    'reqd' => "no",
     272    'hiddengli' => "yes" },
     273      { 'name' => "library_name",
     274    'desc' => "{buildcol.library_name}",
     275    'type' => "string",
    261276    'reqd' => "no",
    262277    'hiddengli' => "yes" },
     
    318333      elsif ($subclass ne $required_subclass)
    319334      {
    320         print STDERR "Error! You cannot specify arguments from two different extention specific buildcolutils modules: " . $subclass . " != " . $required_subclass . "\n";
     335        print STDERR "Error! You cannot specify arguments from two different extension specific buildcolutils modules: " . $subclass . " != " . $required_subclass . "\n";
    321336        exit;
    322337      }
     
    331346    $buildcolutils = new $subclass(\@ARGV, $options);
    332347  }
    333   # We don't have a overridden buildcolutils, or the above command failed
     348  # We don't have an overridden buildcolutils, or the above command failed
    334349  # somehow so load the base class
    335350  if (!defined $buildcolutils)
  • main/trunk/greenstone2/perllib/buildcolutils.pm

    r30523 r31753  
    676676    map { local $_=$_; $_->build_indexes($indexname, $indexlevel); } @builders;
    677677
    678     # Need to deactivate the collection for collections whose db don't support concurrent R+W
     678    # If incremental, need to deactivate the collection for collections whose db don't support concurrent R+W
    679679    # All except the collection (1st parameter) can be empty. For GS3, also set the site parameter
    680680    my $gsserver = new servercontrol( $self->get_collection(), $self->{'site'}, $self->{'verbosity'}, $self->{'builddir'}, $self->{'indexdir'}, $self->{'collectdir'}, $self->{'library_url'}, $self->{'library_name'});
    681681
    682     # when incrementally rebuilding a collection using any db that doesn't support concurrent
     682    # when *incrementally* rebuilding a collection using any db that *doesn't* support concurrent
    683683    # read and write (e.g. gdbm), need to deactivate the collection before make_infodatabase()   
    684684    map {
     
    689689        my $dbSupportsConcurrentRW = &dbutil::supportsConcurrentReadAndWrite($infodbtype);
    690690   
    691         if(!$dbSupportsConcurrentRW) {
     691        if(!$dbSupportsConcurrentRW && $self->{'incremental'}) {
    692692        $gsserver->print_task_msg("About to deactivate collection ".$self->get_collection());
    693693        $gsserver->do_deactivate();     
     
    713713    local $_=$_;
    714714
    715     # when incrementally rebuilding a collection using any db that doesn't support concurrent
     715    # when *incrementally* rebuilding a collection using any db that *doesn't* support concurrent
    716716    # read and write (e.g. gdbm), need to deactivate the collection before make_infodatabase()
    717717
     
    720720        my $dbSupportsConcurrentRW = &dbutil::supportsConcurrentReadAndWrite($infodbtype);
    721721   
    722         if(!$dbSupportsConcurrentRW) {
     722        if(!$dbSupportsConcurrentRW && $self->{'incremental'}) {
    723723        $gsserver->print_task_msg("About to deactivate collection ".$self->get_collection());
    724724        $gsserver->do_deactivate();
Note: See TracChangeset for help on using the changeset viewer.