Ignore:
Timestamp:
2013-06-24T17:23:04+12:00 (8 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed it so that the gdb files generated on Windows for diffcol match those on Linux. This actually involved changing the order in which docids appear in archiveinf-doc. This last needed the newly invented flag -sort to the ArchivesInfPlugin in combination with -sortmeta OID to import.pl

File:
1 edited

Legend:

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

    r21857 r27697  
    6767        'reverse-info'=>{},
    6868        'order'=>[],
    69         'reverse_sort'=>0};
     69        'reverse_sort'=>0,
     70        'sort'=>0};
    7071
    7172    return bless $self, $class;
     
    323324
    324325    $self->{'info'}->{$OID} = [$doc_file,$index_status,$sortmeta];
    325     push (@{$self->{'order'}}, [$OID, $sortmeta]);
     326    push (@{$self->{'order'}}, [$OID, $sortmeta]); # ORDER_OID_INDEX and ORDER_SORT_INDEX
    326327
    327328
     
    393394    $self->{'reverse_sort'} = 1;
    394395}
     396sub sort
     397{
     398    my $self = shift(@_);
     399    $self->{'sort'} = 1;
     400}
     401
    395402
    396403# returns a list of the form [[OID, doc_file, index_status], ...]
     
    404411    if ($self->{'reverse_sort'}) {
    405412    @sorted_order = sort {$b->[ORDER_SORT_INDEX] cmp $a->[ORDER_SORT_INDEX]} @$order;
    406     } else {
     413    } elsif ($self->{'sort'}) {
    407414    @sorted_order = sort {$a->[ORDER_SORT_INDEX] cmp $b->[ORDER_SORT_INDEX]} @$order;
     415    } else { # not sorting, don't bother
     416    @sorted_order = @$order;
    408417    }
    409418
     
    430439    if ($self->{'reverse_sort'}) {
    431440    @sorted_order = sort {$b->[ORDER_SORT_INDEX] cmp $a->[ORDER_SORT_INDEX]} @$order;
    432     } else {
     441    } elsif ($self->{'sort'}) {
    433442    @sorted_order = sort {$a->[ORDER_SORT_INDEX] cmp $b->[ORDER_SORT_INDEX]} @$order;
     443    } else { # not sorting, don't bother
     444    @sorted_order = @$order;
    434445    }
    435446
Note: See TracChangeset for help on using the changeset viewer.