Ignore:
Timestamp:
2013-05-14T11:11:21+12:00 (11 years ago)
Author:
kjdon
Message:

changes to match mgpp's shortname mapping stuff. Changed some util functions to FileUtil functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/lucenebuilder.pm

    r27301 r27329  
    4747no strict 'refs';
    4848use util;
     49use FileUtils;
    4950
    5051sub BEGIN {
     
    6465    # If ENABLE_LUCENE was turned off during GS compilation, then we won't be able to
    6566    # continue. Check for existence of LuceneWrapper to see if Lucene was disabled.
    66     my $lucene = &util::filename_cat($ENV{'GSDLHOME'},"bin","java","LuceneWrapper.jar");
     67    my $lucene = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin","java","LuceneWrapper3.jar");
    6768    if (! -f $lucene) {
    6869    die "***** ERROR: $lucene does not exist\n";     
     
    7475
    7576    # So where is lucene_passes.pl anyway?
    76     my $lucene_passes_script = &util::filename_cat($scriptdir, "lucene_passes.pl");
     77    my $lucene_passes_script = &FileUtils::filenameConcatenate($scriptdir, "lucene_passes.pl");
    7778
    7879    # So tack perl on the beginning to ensure execution
     
    109110    if (defined $buildcfg->{'indexfields'}) {
    110111    foreach $field (@{$buildcfg->{'indexfields'}}) {
    111         $self->{'buildproc'}->{'indexfields'}->{$field} = 1;
     112        # extraindexfields is only supposed to have extra ones in it, not those already specified in indexes. And this list has all indexes in it. But we do a check before including things from extraindexfields whether it was specified in indexes, so it all ok.
     113        $self->{'buildproc'}->{'extraindexfields'}->{$field} = 1;
    112114    }
    113115    }
     
    116118    foreach $field (@{$buildcfg->{'indexfieldmap'}}) {
    117119        my ($f, $v) = $field =~ /^(.*)\-\>(.*)$/;
    118         $self->{'buildproc'}->{'indexfieldmap'}->{$f} = $v;
    119         $self->{'buildproc'}->{'indexfieldmap'}->{$v} = 1;
     120        $self->{'buildproc'}->{'fieldnamemap'}->{$f} = $v;
     121        $self->{'buildproc'}->{'fieldnamemap'}->{$v} = 1;
     122        $self->{'buildproc'}->{'allindexfields'}->{$f} = 1;
    120123    }
    121124    }       
     
    151154
    152155    # the text directory
    153     my $text_dir = &util::filename_cat($self->{'build_dir'}, "text");
    154     my $build_dir = &util::filename_cat($self->{'build_dir'},"");
    155     &util::mk_all_dir ($text_dir);
     156    my $text_dir = &FileUtils::filenameConcatenate($self->{'build_dir'}, "text");
     157    my $build_dir = &FileUtils::filenameConcatenate($self->{'build_dir'},"");
     158    &FileUtils::makeAllDirectories ($text_dir);
    156159
    157160    my $osextra = "";
     
    209212    $self->{'buildproc'}->set_index ($textindex);
    210213    $self->{'buildproc'}->set_indexing_text (0);
    211     #$self->{'buildproc'}->set_indexfieldmap ($self->{'indexfieldmap'});
    212214    $self->{'buildproc'}->set_levels ($levels);
    213215    $self->{'buildproc'}->set_db_level ($db_level);
     
    306308    # get the full index directory path and make sure it exists
    307309    my $indexdir = $self->{'index_mapping'}->{$index};
    308     &util::mk_all_dir (&util::filename_cat($build_dir, $indexdir));
     310    &FileUtils::makeAllDirectories (&FileUtils::filenameConcatenate($build_dir, $indexdir));
    309311
    310312    # get any os specific stuff
     
    433435
    434436    # Get info database file path
    435     my $text_directory_path = &util::filename_cat($self->{'build_dir'}, "text");
     437    my $text_directory_path = &FileUtils::filenameConcatenate($self->{'build_dir'}, "text");
    436438    my $infodb_file_path = &dbutil::get_infodb_file_path($self->{'infodbtype'}, $self->{'collection'}, $text_directory_path);
    437439
     
    460462    #    don't expect to pipe anything to the database so we can do away with the
    461463    #    complex output handle.
    462     my $assocdir = &util::filename_cat($self->{'build_dir'}, "assoc");
    463     &util::mk_all_dir ($assocdir);
     464    my $assocdir = &FileUtils::filenameConcatenate($self->{'build_dir'}, "assoc");
     465    &FileUtils::makeAllDirectories ($assocdir);
    464466    $self->{'buildproc'}->set_mode ('incinfodb'); # Very Important
    465467    $self->{'buildproc'}->set_assocdir ($assocdir);
Note: See TracChangeset for help on using the changeset viewer.