Changeset 15072

Show
Ignore:
Timestamp:
10.03.2008 09:31:58 (11 years ago)
Author:
kjdon
Message:

added -reversesort option to import.pl. Used with -sortmeta option, to sort in reverse order

Files:
1 modified

Legend:

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

    r14957 r15072  
    209209    'desc' => "{import.sortmeta}", 
    210210    'type' => "metadata", 
    211 #   'type' => "string", 
     211    'reqd' => "no", 
     212    'modegli' => "3" }, 
     213      { 'name' => "reversesort", 
     214    'desc' => "{import.reversesort}", 
     215    'type' => "flag", 
    212216    'reqd' => "no", 
    213217    'modegli' => "3" }, 
     
    278282    $archivedir,  
    279283    $gzip, $groupsize,  
    280     $sortmeta, $removeprefix, $removesuffix,  
     284    $sortmeta, $reversesort, $removeprefix, $removesuffix,  
    281285    ); 
    282286 
     
    459463    $sortmeta = undef; 
    460464    } 
    461  
     465     
     466    if (defined $sortmeta) { 
     467    if (defined $collectcfg->{'reversesort'} && $collectcfg->{'reversesort'} =~ /^true$/i) { 
     468        $reversesort = 1; 
     469    } 
     470    } else { 
     471    # reversesort only valid with sortmeta 
     472    $reversesort = 0; 
     473    } 
    462474    if (defined $collectcfg->{'removeprefix'} && $removeprefix eq "") { 
    463475    $removeprefix = $collectcfg->{'removeprefix'}; 
     
    539551    $archive_info = new arcinfo (); 
    540552    $archive_info->load_info ($archive_info_filename); 
    541      
     553    if ($reversesort) { 
     554    $archive_info->reverse_sort(); 
     555    } 
    542556 
    543557    ####Use Plugout####