- Timestamp:
- 2007-12-19T15:03:24+13:00 (16 years ago)
- Location:
- gsdl/trunk/bin/script
- Files:
-
- 5 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, -
gsdl/trunk/bin/script/buildcol.pl
r14247 r14925 99 99 'reqd' => "no", 100 100 'hiddengli' => "yes" }, 101 { 'name' => "site", 102 'desc' => "{buildcol.site}", 103 'type' => "string", 104 'deft' => "", 105 'reqd' => "no", 106 'hiddengli' => "yes" }, 101 107 { 'name' => "create_images", 102 108 'desc' => "{buildcol.create_images}", … … 269 275 { 270 276 # command line args 271 my ($verbosity, $archivedir, $cachedir, $builddir, $ maxdocs,277 my ($verbosity, $archivedir, $cachedir, $builddir, $site, $maxdocs, 272 278 $debug, $mode, $indexname, $removeold, $keepold, $incremental, 273 279 $remove_empty_classifications, … … 332 338 333 339 # get and check the collection 334 if (($collection = & util::use_collection(@ARGV, $collectdir)) eq "") {340 if (($collection = &colcfg::use_collection($site, @ARGV, $collectdir)) eq "") { 335 341 &PrintUsage::print_txt_usage($options, "{buildcol.params}"); 336 342 die "\n"; -
gsdl/trunk/bin/script/export.pl
r14733 r14925 117 117 'reqd' => "no", 118 118 'hiddengli' => "yes" }, 119 { 'name' => "site", 120 'desc' => "{import.site}", 121 'type' => "string", 122 'deft' => "", 123 'reqd' => "no", 124 'hiddengli' => "yes" }, 119 125 { 'name' => "collectdir", 120 126 'desc' => "{export.collectdir}", 121 127 'type' => "string", 122 'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 123 'reqd' => "no", 128 # parsearg left "" as default 129 #'deft' => &util::filename_cat ($ENV{'GSDLHOME'}, "collect"), 130 'reqd' => "no", 124 131 'hiddengli' => "yes" }, 125 132 { 'name' => "listall", … … 247 254 sub main { 248 255 # params 249 my ($language, $verbosity, $importdir, $exportdir, $ keepold, $listall,256 my ($language, $verbosity, $importdir, $exportdir, $site, $keepold, $listall, 250 257 $removeold, $saveas, $saveas_version, $debug, $OIDtype, $OIDmetadata, 251 $maxdocs, $statsfile, $xsltfile, $mapping_file, $out, $faillog, 258 $maxdocs, $statsfile, $xsltfile, $mapping_file, $out, $faillog, $gs_mode, $collectcfg, 252 259 $collectdir, $gli,$xslt_mets,$xslt_txt,$group_marc); 253 260 my $xml = 0; … … 334 341 eval { 335 342 # get and check the collection name 336 if (($collection = &util::use_collection($collect_name, $collectdir)) eq "") { 343 print STDERR "**** site = $site\n"; 344 if (($collection = &colcfg::use_collection($site, $collect_name, $collectdir)) eq "") { 337 345 &PrintUsage::print_txt_usage($options, "{export.params}"); 338 346 die "\n"; … … 365 373 my @global_opts = (); 366 374 367 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 368 if (!-e $configfilename) { 369 (&gsprintf($out, "{common.cannot_find_cfg_file}\n", $configfilename) && die); 370 } 371 372 my $collectcfg = &colcfg::read_collect_cfg ($configfilename); 375 # Read in the collection configuration file. 376 ($configfilename, $gs_mode) = &colcfg::get_collect_cfg_name($out); 377 378 if ($gs_mode eq "gs2") { 379 $collectcfg = &colcfg::read_collect_cfg ($configfilename); 380 } elsif ($gs_mode eq "gs3") { 381 $collectcfg = &colcfg::read_collection_cfg_xml ($configfilename); 382 } 383 373 384 if (defined $collectcfg->{'plugin'}) { 374 385 $plugins = $collectcfg->{'plugin'}; -
gsdl/trunk/bin/script/filecopy.pl
r2495 r14925 48 48 print STDERR " -follow_links Follow symbolic links when recursing directory\n"; 49 49 print STDERR " structure\n"; 50 print STDERR " -collectdir directory Collection directory (defaults to " . 51 &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n"; 50 print STDOUT " -collectdir directory Collection directory (defaults to " . 51 &util::filename_cat($ENV{'GSDLHOME'}). "collect for Greenstone2;\n"; 52 print STDOUT" for Greenstone3 use -site option and then collectdir default will be\n"; 53 print STDOUT " set to the collect folder within that site.)\n"; 54 print STDOUT " -site Specify the site within a Greenstone3 installation to use.\n"; 52 55 print STDERR " -out Filename or handle to print output status to.\n"; 53 56 print STDERR " The default is STDERR\n\n"; … … 116 119 'follow_links', \$follow_links, 117 120 'collectdir/.*/', \$collectdir, 121 'site/.*/', \$site, 118 122 'out/.*/STDERR', \$out)) { 119 123 &print_usage(); … … 121 125 } 122 126 123 if ($collectdir !~ /\w/) { 124 $collectdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect"); 127 128 if (defined $site) 129 { 130 die "GSDL3HOME not set." unless $ENV{'GSDL3HOME'}; 131 $collectdir = &util::filename_cat ($ENV{'GSDL3HOME'}, "sites", $site, "collect") unless $collectdir =~ /\w/; 132 } 133 else 134 { 135 $collectdir = &util::filename_cat ($ENV{'GSDLHOME'}, "collect") unless $collectdir =~ /\w/; 125 136 } 126 137 -
gsdl/trunk/bin/script/import.pl
r14556 r14925 99 99 'reqd' => "no", 100 100 'hiddengli' => "yes" }, 101 { 'name' => "site", 102 'desc' => "{import.site}", 103 'type' => "string", 104 'deft' => "", 105 'reqd' => "no", 106 'hiddengli' => "yes" }, 101 107 { 'name' => "manifest", 102 108 'desc' => "{import.manifest}", … … 239 245 240 246 sub main { 241 my ($verbosity, $importdir, $archivedir, $ manifest, $incremental, $keepold,247 my ($verbosity, $importdir, $archivedir, $site, $manifest, $incremental, $keepold, 242 248 $removeold, $saveas, $version, 243 249 $gzip, $groupsize, $OIDtype, $OIDmetadata, $debug, … … 302 308 303 309 # get and check the collection name 304 if (($collection = & util::use_collection(@ARGV, $collectdir)) eq "") {310 if (($collection = &colcfg::use_collection($site, @ARGV, $collectdir)) eq "") { 305 311 &PrintUsage::print_txt_usage($options, "{import.params}"); 306 312 die "\n"; … … 325 331 # Read in the collection configuration file. 326 332 ($configfilename, $gs_mode) = &colcfg::get_collect_cfg_name($out); 333 327 334 if ($gs_mode eq "gs2") { 328 335 $collectcfg = &colcfg::read_collect_cfg ($configfilename);
Note:
See TracChangeset
for help on using the changeset viewer.