Changeset 20095

Show
Ignore:
Timestamp:
29.07.2009 12:12:24 (10 years ago)
Author:
kjdon
Message:

changes for cfgread4gs3 renaming, and to make this look for buildConfig.xml instead of only build.cfg

Files:
1 modified

Legend:

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

    r19218 r20095  
    5252 
    5353# used to signify "gs2"(default) or "gs3" 
    54 my $gs_mode = "gs2"; 
     54our $gs_mode = "gs2"; 
    5555 
    5656sub new { 
     
    8484    $self->{'gli'} = 0 unless defined $self->{'gli'}; 
    8585     
    86     # disable_OIA applies to greenstone 3 only and is only passed to &colcfg::write_build_cfg_xml (then cfgread4gs3::write_cfg_file) when writing the buildConfig.xml 
     86    # disable_OAI applies to greenstone 3 only and is only passed to &colcfg::write_build_cfg_xml (then buildConfigxml::write_build_cfg_file) when writing the buildConfig.xml 
    8787    $self->{'disable_OAI'} = 0 unless defined $self->{'disable_OAI'}; 
    8888 
     
    642642    my $self = shift(@_); 
    643643 
    644     my $buildconfigfile = &util::filename_cat($self->{'build_dir'}, "build.cfg"); 
     644    my $buildconfigfilename; 
     645     
     646    if ($gs_mode eq "gs2") { 
     647    $buildconfigfilename = "build.cfg"; 
     648    } else { 
     649    $buildconfigfilename = "buildConfig.xml"; 
     650    } 
     651     
     652    my $buildconfigfile = &util::filename_cat($self->{'build_dir'}, $buildconfigfilename); 
    645653     
    646654    if (!-e $buildconfigfile) { 
    647655    # try the index dir - but do we know where it is?? try here 
    648     $buildconfigfile  = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "index", "build.cfg"); 
     656    $buildconfigfile  = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "index", $buildconfigfilename); 
    649657    if (!-e $buildconfigfile) { 
    650658        #we cant find a config file - just ignore the field list 
     
    652660    } 
    653661    }  
    654  
    655     my $buildcfg = &colcfg::read_build_cfg( $buildconfigfile); 
    656     return $buildcfg; 
    657  
     662    if ($gs_mode eq "gs2") { 
     663    return &colcfg::read_build_cfg( $buildconfigfile); 
     664    }  
     665    print STDERR "read build cfg basebuilder***\n"; 
     666    return &buildConfigxml::read_cfg_file($buildconfigfile); 
     667     
     668     
    658669} 
    659670