Changeset 22459

Show
Ignore:
Timestamp:
21.07.2010 12:16:18 (10 years ago)
Author:
davidb
Message:

main() functiion should not try to build collection if not run with a collection name (e.g. run with -xml for GLI to get command line options). If statement added to do this

Location:
main/trunk/greenstone2/bin/script
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/export.pl

    r22421 r22459  
    277277     
    278278    my $collection = $inexport->get_collection(); 
    279     my ($config_filename,$collect_cfg) = $inexport->read_collection_cfg($collection,$options);     
    280     $inexport->set_collection_options($collect_cfg); 
     279 
     280    if (defined $collection) { 
     281    my ($config_filename,$collect_cfg)  
     282        = $inexport->read_collection_cfg($collection,$options);     
     283 
     284    $inexport->set_collection_options($collect_cfg); 
    281285     
    282     my $pluginfo = $inexport->process_files($config_filename,$collect_cfg); 
    283  
    284     $inexport->generate_statistics($pluginfo); 
     286    my $pluginfo = $inexport->process_files($config_filename,$collect_cfg); 
     287     
     288    $inexport->generate_statistics($pluginfo); 
     289    } 
    285290} 
    286291 
  • main/trunk/greenstone2/bin/script/import.pl

    r22421 r22459  
    266266     
    267267    my $collection = $inexport->get_collection(); 
    268     my ($config_filename,$collect_cfg) = $inexport->read_collection_cfg($collection,$options);     
    269     $inexport->set_collection_options($collect_cfg); 
    270      
    271     my $pluginfo = $inexport->process_files($config_filename,$collect_cfg); 
    272  
    273     $inexport->generate_statistics($pluginfo); 
     268 
     269    if (defined $collection) { 
     270    my ($config_filename,$collect_cfg)  
     271        = $inexport->read_collection_cfg($collection,$options);     
     272 
     273    $inexport->set_collection_options($collect_cfg); 
     274     
     275    my $pluginfo = $inexport->process_files($config_filename,$collect_cfg); 
     276     
     277    $inexport->generate_statistics($pluginfo); 
     278    } 
    274279} 
    275280