Changeset 28077

Show
Ignore:
Timestamp:
16.08.2013 18:59:26 (6 years ago)
Author:
ak19
Message:

Fix noticed when doing diffcol. When the import option saveas was set to GreenstoneMETS in collect.cfg, this was ignored, although passing it as a cmdline option to import.pl worked. The reason was that the saveas option had a default assigned, unlike OIDtype, and if it already had a value, then any value in collect.cfg was never consulted. Now the METS tutorial collection should work from the cmdline.

Location:
main/trunk/greenstone2
Files:
2 modified

Legend:

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

    r27351 r28077  
    118118    'type' => "enum", 
    119119    'list' => $saveas_list, 
    120     'deft' => "GreenstoneXML", 
     120    #'deft' => "GreenstoneXML", # if saveas is defined a default here, then any valid value provided in collect.cfg is ignored 
    121121    'reqd' => "no", 
    122122    'modegli' => "3" }; 
  • main/trunk/greenstone2/perllib/inexport.pm

    r27698 r28077  
    309309    if (defined $collectcfg->{'groupsize'} && $collectcfg->{'groupsize'} =~ /\d+/) { 
    310310        $self->{'groupsize'} = $collectcfg->{'groupsize'}; 
     311    } 
     312    } 
     313     
     314    if (!defined $self->{'saveas'} 
     315    || ($self->{'saveas'} !~ /^(GreenstoneXML|GreenstoneMETS)$/ )) { 
     316    # saveas was either not defined on the command-line, or it was not one of the recognized values 
     317    if (defined $collectcfg->{'saveas'}  
     318        && $collectcfg->{'saveas'} =~ /^(GreenstoneXML|GreenstoneMETS)$/) { 
     319        $self->{'saveas'} = $collectcfg->{'saveas'}; 
     320    } else { 
     321        $self->{'saveas'} = "GreenstoneXML"; # the default 
    311322    } 
    312323    }