Changeset 17573

Show
Ignore:
Timestamp:
23.10.2008 09:59:13 (11 years ago)
Author:
kjdon
Message:

moved a couple of things around, added read_build_cfg which finds and reads in build.cfg file, added init_for_incremental_build

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/basebuilder.pm

    r17110 r17573  
    227227    &util::mk_all_dir($textdir); 
    228228    } 
    229      
     229 
     230    if ($self->{'incremental'}) { 
     231    # some classes may need to do some additional initialisation 
     232    $self->init_for_incremental_build(); 
     233    } 
     234     
     235} 
     236 
     237# implement this in subclass if want to do additional initialisation for an 
     238# incremental build 
     239sub init_for_incremental_build { 
     240    my $self = shift (@_); 
    230241} 
    231242 
     
    316327} 
    317328 
     329# implement this in subclass if want to do extra stuff at the end of building 
     330# all the indexes 
    318331sub build_indexes_extra { 
    319332    my $self = shift(@_); 
     
    504517    print STDERR "</Stage>\n" if $self->{'gli'}; 
    505518} 
     519 
     520# implement this in subclass if want to add extra stuff to build.cfg 
     521sub build_cfg_extra { 
     522   my $self = shift(@_); 
     523   my ($build_cfg) = @_; 
     524    
     525} 
     526 
    506527 
    507528sub collect_specific { 
     
    580601} 
    581602 
    582 # implement this in subclass if want to add extra stuff to build.cfg 
    583 sub build_cfg_extra { 
    584    my $self = shift(@_); 
    585    my ($build_cfg) = @_; 
    586     
    587 } 
    588603 
    589604 
     
    620635} 
    621636 
     637# sometimes we need to read in an existing build.cfg - for example,  
     638# if doing each stage of building separately, or when doing incremental  
     639# building 
     640sub read_build_cfg { 
     641    my $self = shift(@_); 
     642 
     643    my $buildconfigfile = &util::filename_cat($self->{'build_dir'}, "build.cfg"); 
     644     
     645    if (!-e $buildconfigfile) { 
     646    # try the index dir - but do we know where it is?? try here 
     647    $buildconfigfile  = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "index", "build.cfg"); 
     648    if (!-e $buildconfigfile) { 
     649        #we cant find a config file - just ignore the field list 
     650        return undef; 
     651    } 
     652    }  
     653 
     654    my $buildcfg = &colcfg::read_build_cfg( $buildconfigfile); 
     655    return $buildcfg; 
     656 
     657} 
    622658 
    623659sub print_stats {