Ignore:
Timestamp:
2011-08-12T19:35:50+12:00 (13 years ago)
Author:
ak19
Message:

Changes to perl code to do with removing the ex. prefix: ex. is only removed if it is the sole prefix (i.e. ex.dc.* prefixes are not removed).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/mgppbuilder.pm

    r22820 r24404  
    101101    if (defined $indexes) {
    102102    $self->{'collect_cfg'}->{'indexes'} = [];
    103     my $single_index = join(';', @$indexes).";";
    104     # remove any ex. from index spec
    105     $single_index =~ s/^ex\.//;
    106     $single_index =~ s/([,;])ex\./$1/g;
     103
     104    # remove any ex. from index spec but iff it is the only namespace in the metadata name
     105    my @indexes_copy = @$indexes; # make a copy, as 'map' changes entry in array
     106    #map { $_ =~ s/(^|,|;)ex\.([^.]+)$/$1$2/; } @indexes_copy; # No. Will replace metanames like flex.Image with fl.Image
     107    map { $_ =~ s/(,|;)/$1 /g; } @indexes_copy; # introduce a space after every separator
     108    map { $_ =~ s/(^| )ex\.([^.,:]+)(,|;|$)/$1$2$3/g; } @indexes_copy; # replace all <ex.> at start of metanames or <, ex.> when in a comma separated list
     109    map { $_ =~ s/(,|:) /$1/g; } @indexes_copy; # remove space introduced after every separator
     110    my $single_index = join(';', @indexes_copy).";";
     111
    107112    push (@{$self->{'collect_cfg'}->{'indexes'}}, $single_index);
    108113    }
Note: See TracChangeset for help on using the changeset viewer.