Changeset 14022


Ignore:
Timestamp:
04/24/07 17:13:57 (14 years ago)
Author:
xiao
Message:
  1. Changes made to look for collectionConfig.xml in gs3 mode and collect.cfg in gs2 mode, rather than presumably only for the file collect.cfg. 2. Changes made to use cfgread4gs3.pm in gs3 mode and cfgread.pm in gs2 mode.
File:
1 edited

Legend:

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

    r12972 r14022  
    4747our $maxdocsize = 12000;
    4848
     49# used to signify "gs2"(default) or "gs3"
     50my $gs_mode = "gs2";
     51
    4952sub new {
    5053    my ($class, $collection, $source_dir, $build_dir, $verbosity,
     
    7982    # read in the collection configuration file
    8083    my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collect.cfg";
    81     if (!-e $colcfgname) {
     84    if (-e $colcfgname) {
     85      $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname);
     86      $gs_mode = "gs2";
     87    }
     88    else {
     89      my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collectionConfig.xml";
     90      if (!-e $colcfgname) {
    8291    die "mgbuilder::new - couldn't find collect.cfg for collection $collection\n";
    83     }
    84     $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname);
     92      }
     93      else {
     94    $self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname);
     95    $gs_mode = "gs3";
     96      }
     97    }
    8598   
    8699    # get the list of plugins for this collection
     
    447460
    448461    $self->build_cfg_extra($build_cfg);
    449    
    450     &colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg);
     462
     463    if ($gs_mode eq "gs2") {
     464      &colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg);
     465    }
     466    if ($gs_mode eq "gs3") {
     467      &colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg'});
     468    }   
    451469
    452470    print STDERR "</Stage>\n" if $self->{'gli'};
Note: See TracChangeset for help on using the changeset viewer.