Changeset 14925 for gsdl/trunk/bin/script/build
- Timestamp:
- 2007-12-19T15:03:24+13:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/bin/script/build
r13067 r14925 93 93 94 94 my $cdir = $collectdir; 95 $cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect") unless $collectdir =~ /\w/; 95 if (defined $site) 96 { 97 die "GSDL3HOME not set." unless $ENV{'GSDL3HOME'}; 98 $cdir = &util::filename_cat ($ENV{'GSDL3HOME'}, "sites", $site, "collect") unless $collectdir =~ /\w/; 99 } 100 else 101 { 102 $cdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect") unless $collectdir =~ /\w/; 103 } 104 96 105 my $importdir = &util::filename_cat ($cdir, $collection, "import"); 97 106 my $archivedir = &util::filename_cat ($cdir, $collection, "archives"); … … 177 186 print STDOUT " a -download option is supplied\n"; 178 187 print STDOUT " -collectdir directory Collection directory (defaults to " . 179 &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n"; 188 &util::filename_cat($ENV{'GSDLHOME'}). "collect for Greenstone2;\n"; 189 print STDOUT" for Greenstone3 use -site option and then collectdir default will be\n"; 190 print STDOUT " set to the collect folder within that site.)\n"; 191 print STDOUT " -site Specify the site within a Greenstone3 installation to use.\n"; 180 192 print STDOUT " -dontinstall Only applicable if -collectdir is set to something\n"; 181 193 print STDOUT " other than the default. -dontinstall will suppress\n"; … … 297 309 my $download_cmd = "perl -S filecopy.pl"; 298 310 $download_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; 311 $download_cmd .= " -site \"$site\"" if $site =~ /\w/; 299 312 $download_cmd .= " -out \"$outfile.download\"" if $use_out; 300 313 $download_cmd .= " \"" . $download_dir . "\" " . $collection; 301 system ($download_cmd); 314 315 my $download_status = system ($download_cmd); 316 if ($download_status > 0) 317 { 318 die "Failed to execute: $download_cmd\n"; 319 } 320 321 302 322 # if using output directory append the file download output to it 303 323 &append_file ($out, "$outfile.download"); … … 308 328 } 309 329 } 330 331 `echo $importdir ; ls $importdir `; 310 332 311 333 if (-e &util::filename_cat ($archivedir, "archives.inf")) { … … 355 377 356 378 if ($collectdir ne "" && !$dontinstall) { 357 my $install_collectdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect"); 379 380 my $install_collectdir; 381 if (defined $ENV{'GSDL3HOME'}) 382 { 383 384 if ((defined $site) && ($site ne "")) 385 { 386 $install_collectdir = &util::filename_cat ($ENV{'GSDL3HOME'}, "sites", $site, "collect"); 387 } 388 else 389 { 390 my $msg = "build: ERROR: Need to specify the site within the Greenstone3 installation."; 391 print $out $msg; 392 &log_event ($msg); 393 &final_out (6) if $use_out; 394 die "\n"; 395 } 396 } 397 else 398 { 399 $install_collectdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect"); 400 } 401 358 402 if (!&util::filenames_equal ($collectdir, $install_collectdir)) { 359 403 … … 403 447 404 448 $import_cmd .= " -manifest manifest.xml" if ($manifest); 449 $import_cmd .= " -site \"$site\"" if $site =~ /\w/; 405 450 $import_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; 406 451 $import_cmd .= " -statsfile \"$statsfile\"" if $statsfile =~ /\w/; … … 447 492 448 493 $build_cmd .= " -out \"$outfile.build\"" if $use_out; 494 $build_cmd .= " -site \"$site\"" if $site =~ /\w/; 449 495 $build_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; 450 496 $build_cmd .= " $maxdocs $collection"; … … 503 549 } 504 550 } 551 505 552 return 0; 506 553 } … … 605 652 'download/.+', \@download, 606 653 'collectdir/.*/', \$collectdir, 654 'site/.*/', \$site, 607 655 'dontinstall', \$dontinstall, 608 656 'save_archives', \$save_archives,
Note:
See TracChangeset
for help on using the changeset viewer.