Ignore:
Timestamp:
2006-07-04T15:36:20+12:00 (18 years ago)
Author:
davidb
Message:

Scripts upgraded to perform more efficiently with incremental addition.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/build

    r2892 r12003  
    155155    print STDOUT "   -optionfile file        Get options from file, useful on systems where\n";
    156156    print STDOUT "                           long command lines may cause problems\n";
     157    print STDOUT "   -indextype mg|mgpp|lucene \n";
     158    print STDERR "                           Specify the type of indexer used in this collection\n";
     159    print STDERR "                           If -append is used then -indextype is needed to \n";
     160    print STDERR "                           determine how to run buildcol.pl as well as update\n";
     161    print STDERR "                           'building' and 'index' according.\n";
    157162    print STDOUT "   -append                 Add new files to existing collection\n";
     163    print STDOUT "   -manifest               Use manifest.xml file to determine which files to process.\n";
    158164    print STDOUT "   -remove_archives        Remove archives directory after successfully\n";
    159165    print STDOUT "                           building the collection.\n";
     
    386392    my $import_cmd = "perl -S import.pl";
    387393    $import_cmd .= " -out \"$outfile.import\"" if $use_out;
    388     $import_cmd .= " -removeold" unless $append;
     394    if ($append) {
     395    $import_cmd .= " -keepold";
     396    } else {
     397    $import_cmd .= " -removeold";
     398    }
     399
     400    $import_cmd .= " -manifest manifest.xml" if ($manifest);
    389401    $import_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/;
    390402    $import_cmd .= " -statsfile \"$statsfile\"" if $statsfile =~ /\w/;
     
    415427
    416428    my $build_cmd = "perl -S buildcol.pl";
     429
     430    my $removeold = 1;
     431    if ($append) {
     432    if ($indextype eq "lucene") {
     433        $build_cmd .= " -keepold";
     434        $removeold = 0;
     435    }
     436    else {
     437        $build_cmd .= " -removeold";
     438    }
     439    }
     440    else {
     441    $build_cmd .= " -removeold";
     442    }
     443
    417444    $build_cmd .= " -out \"$outfile.build\"" if $use_out;
    418445    $build_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/;
     
    437464    }
    438465
    439     # replace old indexes with new ones
    440     if (&has_content ($indexdir)) {
    441     print $out "removing old indexes\n";
    442     &util::rm_r ($indexdir);
    443     }
    444     rmdir ($indexdir) if -d $indexdir;
    445     &File::Copy::move ($buildingdir, $indexdir);
     466    if ($removeold) {
     467    # replace old indexes with new ones
     468    if (&has_content ($indexdir)) {
     469        print $out "removing old indexes\n";
     470        &util::rm_r ($indexdir);
     471    }
     472    rmdir ($indexdir) if -d $indexdir;
     473    &File::Copy::move ($buildingdir, $indexdir);
     474    }
     475    else {
     476    # Do nothing.  Assume index is symbolic link to building
     477    }
    446478
    447479    # remove the cached arhives
     
    560592    if (!parsargv::parse($argref,
    561593             'optionfile/.*/', \$optionfile,
     594             'indextype/^(mg|mgpp|lucene)$/mg', \$indextype,
    562595             'append', \$append,
     596             'manifest', \$manifest,
    563597             'remove_archives', \$remove_archives,
    564598             'remove_import', \$remove_import,
Note: See TracChangeset for help on using the changeset viewer.