Changeset 19751

Show
Ignore:
Timestamp:
08.06.2009 12:37:56 (10 years ago)
Author:
davidb
Message:

Added new function read_collection_cfg() which uses the argument passed in (gs2 or gs3) to work out which read function to use

Files:
1 modified

Legend:

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

    r18528 r19751  
    9393                    q/^(collectionmeta)$/); 
    9494} 
     95 
    9596sub read_collection_cfg_xml { 
    9697    my ($filename) = @_; 
     
    9899    return &cfgread4gs3::read_cfg_file ($filename); 
    99100} 
     101 
     102sub read_collection_cfg { 
     103    my ($filename,$gs_mode) = @_; 
     104     
     105    my $collectcfg = undef; 
     106 
     107    if ($gs_mode eq "gs2") { 
     108    $collectcfg = &colcfg::read_collect_cfg ($filename); 
     109    } elsif ($gs_mode eq "gs3") { 
     110    $collectcfg = &colcfg::read_collection_cfg_xml ($filename); 
     111    } 
     112    else { 
     113    print STDERR "Failed to read collection configuration file\n"; 
     114    print STDERR "  Unrecognized mode: $gs_mode\n"; 
     115    } 
     116 
     117    return $collectcfg; 
     118} 
     119 
     120 
     121 
    100122sub write_collection_cfg_xml { 
    101123  
    102124} 
     125 
    103126sub write_build_cfg_xml { 
    104127    my ($buildoutfile, $buildcfg, $collectcfg, $disable_OAI) = @_;