- Timestamp:
- 2013-10-30T20:54:49+13:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/explode_metadata_database.pl
r27901 r28560 14 14 use encodings; 15 15 use extrametautil; 16 use util; 17 use FileUtils; 16 18 use printusage; 17 19 use parse2; … … 87 89 'type' => "string", 88 90 # parsearg left "" as default 89 #'deft' => & util::filename_cat($ENV{'GSDLHOME'}, "collect"),91 #'deft' => &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "collect"), 90 92 'deft' => "", 91 93 'reqd' => "no", … … 349 351 350 352 # Explode means just that: the original file is deleted 351 & util::rm($filename);353 &FileUtils::removeFiles($filename); 352 354 $plugobj->clean_up_after_exploding(); 353 355 … … 364 366 die "Error: document directory $documents_directory already exists (bailing).\n"; 365 367 } 366 & util::mk_dir($documents_directory);367 368 my $documents_metadata_xml_file = & util::filename_cat($documents_directory, "metadata.xml");368 &FileUtils::makeDirectory($documents_directory); 369 370 my $documents_metadata_xml_file = &FileUtils::filenameConcatenate($documents_directory, "metadata.xml"); 369 371 if (-e $documents_metadata_xml_file) { 370 372 die "Error: documents metadata.xml file $documents_metadata_xml_file already exists (bailing).\n"; … … 427 429 # by first of all stripping any trailing slash and then always ensuring one is used through filename_cat 428 430 $document_prefix =~ s/(\/|\\)$//; 429 $document_file_full = & util::filename_cat($document_prefix, "$value$document_suffix");431 $document_file_full = &FileUtils::filenameConcatenate($document_prefix, "$value$document_suffix"); 430 432 } else { # the doc prefix may also contain the prefix of the actual *filename* following the directory 431 433 $document_file_full = $document_prefix . $value . $document_suffix; … … 560 562 $document_file_full =~ /([^\/]+)$/; 561 563 $document_file_name = $1; 562 $local_document_file = &util::filename_cat($documents_directory, $document_file_name); 564 $local_document_file = &FileUtils::filenameConcatenate($documents_directory, $document_file_name); 565 566 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 567 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 563 568 564 569 my $wget_options = "--quiet"; … … 576 581 else { 577 582 # convert the dirseps in filepath to correct dir sep for OS 578 $document_file_full = & util::filename_cat($document_file_full);583 $document_file_full = &FileUtils::filenameConcatenate($document_file_full); 579 584 my $dir_sep = &util::get_os_dirsep(); 580 585 … … 588 593 if (!$is_absolute) { 589 594 $document_file_full 590 = & util::filename_cat($orig_base_dir,$document_file_full);591 } 592 593 $local_document_file = & util::filename_cat($documents_directory, $document_file_name);595 = &FileUtils::filenameConcatenate($orig_base_dir,$document_file_full); 596 } 597 598 $local_document_file = &FileUtils::filenameConcatenate($documents_directory, $document_file_name); 594 599 595 600 if (-e $document_file_full) { 596 & util::cp($document_file_full, $documents_directory);601 &FileUtils::copyFiles($document_file_full, $documents_directory); 597 602 } 598 603 … … 606 611 # file local to metadata record 607 612 # => copy has been made successfully, so remove original 608 & util::rm($document_file_full);613 &FileUtils::removeFiles($document_file_full); 609 614 } 610 615 }
Note:
See TracChangeset
for help on using the changeset viewer.