Changeset 5094
- Timestamp:
- 2003-08-04T17:17:53+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r4873 r5094 131 131 132 132 my $options = { 'name' => "buildcol.pl", 133 'desc' => " PERL script used to build a greenstone collection from GML documents.",133 'desc' => "{buildcol.desc}", 134 134 'args' => $arguments }; 135 135 … … 143 143 print STDERR "<Info>\n"; 144 144 print STDERR " <Name>$options->{'name'}</Name>\n"; 145 print STDERR " <Desc> $options->{'desc'}</Desc>\n";145 print STDERR " <Desc>" . &lookup_string($options->{'desc'}) . "</Desc>\n"; 146 146 print STDERR " <Arguments>\n"; 147 147 if (defined($options->{'args'})) { … … 167 167 168 168 # Produce the usage information using the data structure above 169 print STDERR " usage: $programname [options] collection-name\n\n"; 169 print STDERR " " . &lookup_string("{common.usage}") . ": $programname"; 170 print STDERR " " . &lookup_string("{buildcol.params}") . "\n\n"; 170 171 171 172 # Display the program options, if there are some … … 174 175 local $optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions 175 176 176 print STDERR " options:\n";177 print STDERR " " . &lookup_string("{common.options}") . ":\n"; 177 178 178 179 # Display the program options 179 180 &PrintUsage::print_options_txt($language, $programargs, $optiondescoffset); 180 181 } 182 } 183 184 185 sub lookup_string 186 { 187 return &PrintUsage::lookup_string($language, shift(@_)); 181 188 } 182 189 … … 269 276 my $close_out = 0; 270 277 if ($out !~ /^(STDERR|STDOUT)$/i) { 271 open (OUT, ">$out") || die "Couldn't open output file $out\n"; 278 open (OUT, ">$out") || 279 die &lookup_string("{common.cannot_open_output_file}") . " $out\n"; 272 280 $out = "buildcol::OUT"; 273 281 $close_out = 1; … … 287 295 # this could potentially create a situation where the faillog keeps being added 288 296 # to over multiple builds (if the import process is being skipped) 289 open (FAILLOG, ">>$faillog") || die "Couldn't open fail log $faillog\n"; 297 open (FAILLOG, ">>$faillog") 298 || die &lookup_string("{common.cannot_open_fail_log}") . " $faillog\n"; 290 299 $faillog = 'buildcol::FAILLOG'; 291 300 $faillog->autoflush(1); … … 362 371 363 372 } else { 364 die "Couldn't find the configuration file$configfilename\n";365 } 366 373 die &lookup_string("{common.cannot_find_cfg_file}") . " $configfilename\n"; 374 } 375 367 376 #set the text index 368 377 if ($buildtype eq "mgpp") { … … 394 403 # update the archive cache if needed 395 404 if ($cachedir) { 396 print $out "Updating archive cache\n" if ($verbosity >= 1); 405 print $out &lookup_string("{buildcol.updating_archive_cache}") . "\n" 406 if ($verbosity >= 1); 397 407 398 408 $cachedir =~ s/[\\\/]+$//; … … 455 465 $builder->make_infodatabase(); 456 466 } else { 457 die "unknown mode:$mode\n";467 die &lookup_string("{buildcol.unknown_mode}") . " $mode\n"; 458 468 } 459 469 … … 462 472 463 473 if (($realbuilddir ne $builddir) && !$debug) { 464 print $out "Copying back the cached build\n" if ($verbosity >= 1); 474 print $out &lookup_string("{buildcol.copying_back_cached_build}") . "\n" 475 if ($verbosity >= 1); 465 476 &util::rm_r ($builddir); 466 477 &util::cp_r ($realbuilddir, $builddir); … … 476 487 my $image_script = &util::filename_cat ($ENV{'GSDLHOME'}, "bin", "script", "gimp", "title_icon-1.2.pl"); 477 488 if (!-e $image_script) { 478 print $out "WARNING: Image making script ($image_script) could not be found\n";479 print $out " Default images will not be generated\n\n";489 print $out &lookup_string("{buildcol.no_image_script}") . ": $image_script."; 490 print $out &lookup_string("{buildcol.no_default_images}") . "\n\n"; 480 491 return; 481 492 } … … 492 503 # to be changed when the config file format changes) 493 504 if (!open (CFGFILE, $configfilename)) { 494 print $out "WARNING: Couldn't open config file ($configfilename)\n";495 print $out " for updating so collection images may not be linked correctly\n";505 print $out &lookup_string("{buildcol.cannot_open_cfg_file}") . ": $configfilename\n"; 506 print $out &lookup_string("{buildcol.unlinked_col_images}") . "\n"; 496 507 return; 497 508 } … … 515 526 516 527 if (!open (CFGFILE, ">$configfilename")) { 517 print $out "WARNING: Couldn't open config file ($configfilename)\n";518 print $out " for updating so collection images may not be linked correctly\n";528 print $out &lookup_string("{buildcol.cannot_open_cfg_file}") . ": $configfilename\n"; 529 print $out &lookup_string("{buildcol.unlinked_col_images}") . "\n"; 519 530 return; 520 531 }
Note:
See TracChangeset
for help on using the changeset viewer.