Changeset 5093
- Timestamp:
- 2003-08-04T16:36:18+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/import.pl
r4873 r5093 129 129 130 130 my $options = { 'name' => "import.pl", 131 'desc' => " PERL script used to import files into a GML format ready for building.",131 'desc' => "{import.desc}", 132 132 'args' => $arguments }; 133 133 … … 141 141 print STDERR "<Info>\n"; 142 142 print STDERR " <Name>$options->{'name'}</Name>\n"; 143 print STDERR " <Desc> $options->{'desc'}</Desc>\n";143 print STDERR " <Desc>" . &lookup_string($options->{'desc'}) . "</Desc>\n"; 144 144 print STDERR " <Arguments>\n"; 145 145 if (defined($options->{'args'})) { … … 165 165 166 166 # Produce the usage information using the data structure above 167 print STDERR " usage: $programname [options] collection-name\n\n"; 167 print STDERR " " . &lookup_string("{common.usage}") . ": $programname"; 168 print STDERR " " . &lookup_string("{import.params}") . "\n\n"; 168 169 169 170 # Display the program options, if there are some … … 172 173 local $optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions 173 174 174 print STDERR " options:\n";175 print STDERR " " . &lookup_string("{common.options}") . ":\n"; 175 176 176 177 # Display the program options 177 178 &PrintUsage::print_options_txt($language, $programargs, $optiondescoffset); 178 179 } 180 } 181 182 183 sub lookup_string 184 { 185 return &PrintUsage::lookup_string($language, shift(@_)); 179 186 } 180 187 … … 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 = 'import::OUT'; 273 281 $close_out = 1; … … 287 295 $faillog = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "etc", "fail.log"); 288 296 } 289 open (FAILLOG, ">$faillog") || die "Couldn't open fail log $faillog\n"; 297 open (FAILLOG, ">$faillog") || 298 die &lookup_string("{import.cannot_open_fail_log}") . " $faillog\n"; 290 299 my $faillogname = $faillog; 291 300 $faillog = 'import::FAILLOG'; … … 295 304 $sortmeta = undef unless defined $sortmeta && $sortmeta =~ /\S/; 296 305 if (defined $sortmeta && $groupsize > 1) { 297 print $out "WARNING: import.pl cannot sort documents when groupsize > 1\n"; 298 print $out " sortmeta option will be ignored\n\n"; 306 print $out &lookup_string("{import.cannot_sort}") . "\n\n"; 299 307 $sortmeta = undef; 300 308 } … … 377 385 378 386 } else { 379 die "Couldn't find the configuration file$configfilename\n";387 die &lookup_string("{import.cannot_find_cfg_file}") . " $configfilename\n"; 380 388 } 381 389 … … 392 400 $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog); 393 401 if (scalar(@$pluginfo) == 0) { 394 print $out "No plugins were loaded.\n";402 print $out &lookup_string("{import.no_plugins_loaded}") . "\n"; 395 403 die "\n"; 396 404 } 397 405 398 406 # remove the old contents of the archives directory if needed 399 407 if ($removeold && -e $archivedir) { 400 print $out "Removing current contents of the archives directory\n";408 print $out &lookup_string("{import.removing_archives}") . "\n"; 401 409 sleep(3); # just in case... 402 410 &util::rm_r ($archivedir); … … 438 446 $close_stats = 1; 439 447 } else { 440 print $out "WARNING: couldn't open stats file $statsfile\n";441 print $out " will print stats to STDERR instead\n";448 print $out &lookup_string("{import.cannot_open_stats_file}") . " $statsfile."; 449 print $out &lookup_string("{import.stats_backup}") . "\n"; 442 450 $statsfile = 'STDERR'; 443 451 } … … 446 454 print $out "\n"; 447 455 print $out "*********************************************\n"; 448 print $out "Import Complete\n";456 print $out &lookup_string("{import.complete}") . "\n"; 449 457 print $out "*********************************************\n"; 450 458 … … 457 465 close FAILLOG; 458 466 } 459
Note:
See TracChangeset
for help on using the changeset viewer.