Changeset 12003 for trunk/gsdl/bin/script/build
- Timestamp:
- 2006-07-04T15:36:20+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/build
r2892 r12003 155 155 print STDOUT " -optionfile file Get options from file, useful on systems where\n"; 156 156 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"; 157 162 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"; 158 164 print STDOUT " -remove_archives Remove archives directory after successfully\n"; 159 165 print STDOUT " building the collection.\n"; … … 386 392 my $import_cmd = "perl -S import.pl"; 387 393 $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); 389 401 $import_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; 390 402 $import_cmd .= " -statsfile \"$statsfile\"" if $statsfile =~ /\w/; … … 415 427 416 428 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 417 444 $build_cmd .= " -out \"$outfile.build\"" if $use_out; 418 445 $build_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; … … 437 464 } 438 465 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 } 446 478 447 479 # remove the cached arhives … … 560 592 if (!parsargv::parse($argref, 561 593 'optionfile/.*/', \$optionfile, 594 'indextype/^(mg|mgpp|lucene)$/mg', \$indextype, 562 595 'append', \$append, 596 'manifest', \$manifest, 563 597 'remove_archives', \$remove_archives, 564 598 'remove_import', \$remove_import,
Note:
See TracChangeset
for help on using the changeset viewer.