Changeset 9546


Ignore:
Timestamp:
2005-04-04T16:14:08+12:00 (19 years ago)
Author:
kjdon
Message:

now teh saveas, removeprefix and removesuffix options can be specified in teh config file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/import.pl

    r9066 r9546  
    221221             'keepold', \$keepold,
    222222             'removeold', \$removeold,
    223              'saveas/^(GA|METS)$/GA', \$saveas,
     223             'saveas/^(GA|METS)$/', \$saveas,
    224224             'gzip', \$gzip,
    225225             'groupsize/\d+/1', \$groupsize,
     
    361361        }
    362362    }
    363     if (defined $collectcfg->{'sortmeta'} && $sortmeta eq "") {
     363    if ($saveas !~ /^(GA|METS)$/) {
     364        if (defined $collectcfg->{'saveas'} && $collectcfg->{'saveas'} =~ /^(GA|METS)$/) {
     365        $saveas = $collectcfg->{'saveas'};
     366        } else {
     367        $saveas ="GA";
     368        }
     369    }
     370    if (defined $collectcfg->{'sortmeta'} && (!defined$sortmeta || $sortmeta eq "")) {
    364371        $sortmeta = $collectcfg->{'sortmeta'};
    365372    }
    366373
     374    if (defined $collectcfg->{'removeprefix'} && $removeprefix eq "") {
     375        $removeprefix = $collectcfg->{'removeprefix'};
     376    }
     377   
     378    if (defined $collectcfg->{'removesuffix'} && $removesuffix eq "") {
     379        $removesuffix = $collectcfg->{'removesuffix'};
     380    }
    367381    if (defined $collectcfg->{'debug'} && $collectcfg->{'debug'} =~ /^true$/i) {
    368382        $debug = 1;
     
    373387
    374388    # global plugin stuff
    375     if (defined $collectcfg->{'separate_cjk'}&& $collectcfg->{'separate_cjk'} =~ /^true$/i) {
     389    if (defined $collectcfg->{'separate_cjk'} && $collectcfg->{'separate_cjk'} =~ /^true$/i) {
    376390        push @global_opts, "-separate_cjk";
    377391    }
Note: See TracChangeset for help on using the changeset viewer.