Changeset 31396


Ignore:
Timestamp:
2017-02-09T18:32:27+13:00 (7 years ago)
Author:
ak19
Message:

2 general bugfixes. Bugs found when preparing to test implementation of OAI deletion policy. 1. buildcol.pl needs to accept but toss OIDtype flag and value, so that we can run full-rebuild.pl and incremental-rebuild.pl with this flag (which will then pass the flag to the appropriate import script, which needs it, and the appropriate buildcol script which used to reject it with an error message). 2. OIDtype and OIDmetadata can end up all lowercase in the collect.cfg file when created by GLI. However, this is not recognised in the perl code, which expects OIDtype and OIDmetadata and sets up keys into hashes with this. Fixed the code to deal with changes to these two alone (not making it case insensitive in general).

Location:
main/trunk/greenstone2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/full-rebuild.pl

    r29109 r31396  
    127127        push(@activate_argv,$activate_arg,$activate_val);
    128128    }
     129    elsif ($arg =~ "-OIDtype") {
     130        shift @argv; # skip OIDtype (don't pass OIDtype to buildcol.pl. It's not currently accepted.)
     131            # this allows us to run full-rebuild.pl -OIDtype filename for instance
     132    }
    129133    else {
    130134        push(@import_argv,$arg);
  • main/trunk/greenstone2/perllib/cfgread.pm

    r26449 r31396  
    159159
    160160        my $key = shift (@$line);
     161       
     162        # OIDtype and OIDmetadata may be present in collect.cfg as "oidtype" and "oidmetadata"
     163        # but rest of perl code expects it to be OIDtype/OIDmetadata and uses these as indexes into hashes
     164        # so convert any lowercase version to uppercase here
     165        if($key =~ m/^oid(type|metadata)/) {           
     166            $key =~ s/^oid/OID/;
     167        }
    161168        if (defined $stringexp && $key =~ /$stringexp/) {
    162169            $data->{$key} = shift (@$line);
  • main/trunk/greenstone2/perllib/colcfg.pm

    r28701 r31396  
    177177                    q/archivedir|exportdir|cachedir|builddir|removeold|/ .
    178178                    q/textcompress|buildtype|othogonalbuildtypes|no_text|keepold|gzip|/ .
    179                     q/verbosity|remove_empty_classifications|OIDtype|OIDmetadata|/ .
     179                    q/verbosity|remove_empty_classifications|OIDtype|OIDmetadata|oidtype|oidmetadata|/ .
    180180                    q/groupsize|maxdocs|debug|mode|saveas|saveas_options|/ .
    181181                    q/sortmeta|removesuffix|removeprefix|create_images|/ .
Note: See TracChangeset for help on using the changeset viewer.