Ignore:
Timestamp:
11/19/18 13:42:05 (2 years ago)
Author:
kjdon
Message:

only set builddir to index if we actually are being incremental. Otherwise, we set remove old, current contents of index deleted, then try to copy index to index, which no longer exists...

File:
1 edited

Legend:

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

    r26567 r32611  
    9292    exit -1;
    9393    }
    94 
    95     if (!defined $build_dir) {
    96     # Yes this is intentional that 'build_dir' points to "index"
    97     $build_dir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'},"index");
    98     push(@filtered_argv,"-builddir",$build_dir);
    99     }
    100 
    101     my $quoted_argv = join(" ", map { "\"$_\"" } @filtered_argv);
    10294   
    10395    my $buildcol_cmd = "\"".&util::get_perl_exec()."\" -S buildcol.pl";
     
    120112    $build_cfg_filename = &util::filename_cat($build_dir, "buildConfig.xml");
    121113    }
    122    
     114
     115    # do we actually want to be incremental?
     116    my $is_incremental = 1;
    123117    if (-e $build_cfg_filename) {
    124118
     
    132126        print STDERR "*****\n";
    133127        $buildcol_cmd .= " -removeold";
     128        $is_incremental = 0;
    134129    }
    135130    else {
     
    144139    print STDERR "*****\n";
    145140    $buildcol_cmd .= " -removeold";
     141    $is_incremental = 0;
    146142    }
    147143
    148    
     144    # if we actually are incremental, then set builddir to index.
     145    if (!defined $build_dir && $is_incremental) {
     146    # Yes this is intentional that 'build_dir' points to "index"
     147    $build_dir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'},"index");
     148    push(@filtered_argv,"-builddir",$build_dir);
     149    }
     150
     151    my $quoted_argv = join(" ", map { "\"$_\"" } @filtered_argv);
     152
    149153    $buildcol_cmd .= " $quoted_argv \"$collection\"";
    150154   
Note: See TracChangeset for help on using the changeset viewer.