- Timestamp:
- 2013-10-30T20:54:49+13:00 (10 years ago)
- Location:
- main/trunk/greenstone2
- Files:
-
- 13 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 } -
main/trunk/greenstone2/bin/script/grab_collection.pl
r2671 r28560 1 1 #!/usr/bin/perl -w 2 2 3 use util; 3 4 4 5 # Both this script and its associated process_html.pl were written by … … 550 551 } 551 552 553 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 554 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 555 552 556 # wget is set to 'q - quiet' and 'nc - dont clobber existing files' 553 557 $kommand = $wget.' -qnc --directory-prefix='.$temp_outputdir.$image_dir.' "'.$found.'"'; -
main/trunk/greenstone2/bin/script/gsWget.pl
r2304 r28560 36 36 37 37 use util; 38 use FileUtils; 38 39 39 40 # wget should live in the Greenstone directory structure 40 41 # we'll bail if we can't find it 41 42 my $exe = &util::get_os_exe (); 42 my $cmd = & util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wget");43 my $cmd = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "wget"); 43 44 $cmd .= $exe; 44 45 if (! -e "$cmd") { … … 52 53 $cmd = "wget"; 53 54 } 55 56 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 57 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 54 58 55 59 # command-line parameters -
main/trunk/greenstone2/bin/script/importfrom.pl
r17198 r28560 40 40 use colcfg; 41 41 use util; 42 use FileUtils; 42 43 use parsargv; 43 44 use FileHandle; … … 62 63 print STDERR " -debug Print imported text to STDOUT\n"; 63 64 print STDERR " -collectdir directory Collection directory (defaults to " . 64 & util::filename_cat($ENV{'GSDLHOME'}, "collect") . ")\n";65 &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "collect") . ")\n"; 65 66 print STDERR " -out Filename or handle to print output status to.\n"; 66 67 print STDERR " The default is STDERR\n\n"; … … 96 97 { 97 98 my ($wget_cmd,$out,$verbosity) = @_; 99 100 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 101 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 98 102 99 103 if ($verbosity>2) { … … 210 214 print $out "Getting document $doc_url\n"; 211 215 212 & util::mk_dir($output_dir) if (!-e "$output_dir");213 214 my $full_id_fname = & util::filename_cat($output_dir,$id_fname);216 &FileUtils::makeDirectory($output_dir) if (!-e "$output_dir"); 217 218 my $full_id_fname = &FileUtils::filenameConcatenate($output_dir,$id_fname); 215 219 216 220 my $wget_cmd = "wget $wgetopt --quiet -O \"$full_id_fname\" \"$doc_url\""; 221 222 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 223 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 217 224 218 225 if (system($wget_cmd)!=0) { … … 245 252 my $i_os = $i; #convert OAI set separators (:) to OS dir sep 246 253 $i_os =~ s/:/$ds/g; 247 my $file_i = & util::filename_cat($output_dir,"$i_os.oai");254 my $file_i = &FileUtils::filenameConcatenate($output_dir,"$i_os.oai"); 248 255 249 256 # obtain record 250 257 my $wget_cmd = "wget $wgetopt -q -O - \"$url\""; 258 259 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 260 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 251 261 252 262 open (OAIIN,"$wget_cmd|") … … 267 277 my ($i_dir,$unused) = dir_file_split($file_i_url); 268 278 269 & util::mk_all_dir($i_dir);279 &FileUtils::makeAllDirectories($i_dir); 270 280 271 281 # look out for identifier tag in metadata section … … 286 296 ## $revised_doc_url =~ s/hdl\.handle\.net/mcgonagall.cs.waikato.ac.nz:8080\/dspace\/handle/; 287 297 288 my $srcdocs_dir = & util::filename_cat($i_dir,"srcdocs");298 my $srcdocs_dir = &FileUtils::filenameConcatenate($i_dir,"srcdocs"); 289 299 290 300 if (get_oai_document($revised_doc_url,$srcdocs_dir, $out)) { … … 360 370 # get acquire list 361 371 my $acquire = []; 362 $configfilename = & util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg");372 $configfilename = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 363 373 if (-e $configfilename) { 364 374 $collectcfg = &colcfg::read_collect_cfg ($configfilename); … … 383 393 # fill in the default import directory if none 384 394 # were supplied, turn all \ into / and remove trailing / 385 $importdir = & util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "import") if $importdir eq "";395 $importdir = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "import") if $importdir eq ""; 386 396 $importdir =~ s/[\\\/]+/\//g; 387 397 $importdir =~ s/\/$//; … … 391 401 print $out "Warning - removing current contents of the import directory\n"; 392 402 print $out " in preparation for the acquire\n"; 393 & util::rm_r($importdir);403 &FileUtils::removeFilesRecursive($importdir); 394 404 } 395 405 -
main/trunk/greenstone2/bin/script/mirror.pl
r24362 r28560 84 84 85 85 # get the etc directory 86 $etcdir = & util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "etc");86 $etcdir = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, "etc"); 87 87 88 88 # check the collection configuration file for options 89 89 my $interval = 0; 90 $configfilename = & util::filename_cat($ENV{'GSDLCOLLECTDIR'},90 $configfilename = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'}, 91 91 "etc", "collect.cfg"); 92 92 if (-e $configfilename) { … … 107 107 # make sure there is an import directory 108 108 if (! -e "$importdir") { 109 & util::mk_dir($importdir);109 &FileUtils::makeDirectory($importdir); 110 110 } 111 111 -
main/trunk/greenstone2/perllib/classify/Phind.pm
r27905 r28560 167 167 168 168 # Ensure the Phind generate scripts are in place 169 170 # the suffix binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 171 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 172 169 173 my $file1 = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "suffix"); 170 174 $file1 .= ".exe" if $ENV{'GSDLOS'} =~ /^windows$/; -
main/trunk/greenstone2/perllib/doc.pm
r27538 r28560 373 373 my $hashfile_exe = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"bin", 374 374 $ENV{'GSDLOS'},"hashfile$osexe"); 375 376 &util::set_gnomelib_env(); # gnomelib_env (particularly lib/libiconv2.dylib) required to run the hashfile executable on Mac Lions 377 # The subroutine will set the gnomelib env once for each subshell launched, by first testing if GEXTGNOME is not already set 375 378 376 379 my $result = "NULL"; -
main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm
r28250 r28560 35 35 use strict; 36 36 use Cwd; 37 use util; 37 38 use IPC::Open3; 38 39 use IO::Select; … … 139 140 140 141 my $self = new BaseDownload($getlist,$inputargs,$hashArgOptLists); 142 143 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 144 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 141 145 142 146 return bless $self, $class; -
main/trunk/greenstone2/perllib/g2futil.pm
r26440 r28560 9 9 } 10 10 11 my $fedora_client_bin = & util::filename_cat($ENV{'FEDORA_HOME'},"client","bin");11 my $fedora_client_bin = &FileUtils::filenameConcatenate($ENV{'FEDORA_HOME'},"client","bin"); 12 12 &util::envvar_append("PATH",$fedora_client_bin); 13 13 } … … 15 15 use strict; 16 16 use util; 17 use FileUtils; 17 18 18 19 sub run_cmd_old … … 186 187 #$ENV{'fgsPassword'} = $options->{'password'}; 187 188 188 #my $prog = & util::filename_cat($ENV{'FEDORA_GSEARCH'}, "runRESTClient.sh");189 my $prog = & util::filename_cat($fedoragsearch_webapp, "client", "runRESTClient.sh");189 #my $prog = &FileUtils::filenameConcatenate($ENV{'FEDORA_GSEARCH'}, "runRESTClient.sh"); 190 my $prog = &FileUtils::filenameConcatenate($fedoragsearch_webapp, "client", "runRESTClient.sh"); 190 191 191 192 my $gsearch_commands = "updateIndex deletePid"; # deletePID … … 214 215 #$ENV{'fgsPassword'} = $options->{'password'}; 215 216 216 #my $prog = & util::filename_cat($ENV{'FEDORA_GSEARCH'}, "runRESTClient.sh");217 my $prog = & util::filename_cat($fedoragsearch_webapp, "client", "runRESTClient.sh");217 #my $prog = &FileUtils::filenameConcatenate($ENV{'FEDORA_GSEARCH'}, "runRESTClient.sh"); 218 my $prog = &FileUtils::filenameConcatenate($fedoragsearch_webapp, "client", "runRESTClient.sh"); 218 219 219 220 my $gsearch_commands = "updateIndex fromPid"; # fromPID … … 231 232 # if GS3, first look for a fedoragsearch webapp installed in Greenstone's tomcat 232 233 if(defined $ENV{'GSDL3SRCHOME'}) { 233 $fedoragsearch_webapp = & util::filename_cat($ENV{'GSDL3SRCHOME'},"packages","tomcat","webapps","fedoragsearch");234 return $fedoragsearch_webapp if (& util::dir_exists($fedoragsearch_webapp));234 $fedoragsearch_webapp = &FileUtils::filenameConcatenate($ENV{'GSDL3SRCHOME'},"packages","tomcat","webapps","fedoragsearch"); 235 return $fedoragsearch_webapp if (&FileUtils::directoryExists($fedoragsearch_webapp)); 235 236 } 236 237 237 238 # next look for a fedoragsearch webapp installed in Fedora's tomcat 238 239 if(defined $ENV{'FEDORA_HOME'}) { 239 $fedoragsearch_webapp = & util::filename_cat($ENV{'FEDORA_HOME'},"tomcat","webapps","fedoragsearch");240 return $fedoragsearch_webapp if (& util::dir_exists($fedoragsearch_webapp));240 $fedoragsearch_webapp = &FileUtils::filenameConcatenate($ENV{'FEDORA_HOME'},"tomcat","webapps","fedoragsearch"); 241 return $fedoragsearch_webapp if (&FileUtils::directoryExists($fedoragsearch_webapp)); 241 242 } 242 243 … … 287 288 288 289 if (opendir(DIR, $full_dir)) { 289 my @sub_dirs = grep { ($_ !~ /^\./) && (-d & util::filename_cat($full_dir,$_)) } readdir(DIR);290 my @sub_dirs = grep { ($_ !~ /^\./) && (-d &FileUtils::filenameConcatenate($full_dir,$_)) } readdir(DIR); 290 291 closedir DIR; 291 292 … … 294 295 295 296 foreach my $hd (@hash_dirs) { 296 my $full_hash_dir = & util::filename_cat($full_dir,$hd);297 my $full_hash_dir = &FileUtils::filenameConcatenate($full_dir,$hd); 297 298 push(@$all_dirs,$full_hash_dir); 298 299 } 299 300 300 301 foreach my $rd (@rec_dirs) { 301 my $full_rec_dir = & util::filename_cat($full_dir,$rd);302 my $full_rec_dir = &FileUtils::filenameConcatenate($full_dir,$rd); 302 303 rec_get_all_hash_dirs($full_rec_dir,$all_dirs); 303 304 } … … 329 330 my $hash_id = undef; 330 331 331 my $docmets_filename = & util::filename_cat($hash_dir,"docmets.xml");332 my $docmets_filename = &FileUtils::filenameConcatenate($hash_dir,"docmets.xml"); 332 333 333 334 if (open(DIN,"<$docmets_filename")) … … 372 373 # to temporarily set CATALINA_HOME to fedora's tomcat. (Catalina is undefined for GS2.) 373 374 my $gs_catalina_home = $ENV{'CATALINA_HOME'} if defined $ENV{'CATALINA_HOME'}; 374 $ENV{'CATALINA_HOME'} = & util::filename_cat($ENV{'FEDORA_HOME'}, "tomcat");375 $ENV{'CATALINA_HOME'} = &FileUtils::filenameConcatenate($ENV{'FEDORA_HOME'}, "tomcat"); 375 376 376 377 # 1. Find out which folder to write to: fedora_host or localhost 377 378 # whichever contains fedora.xml is the one we want (if none, exit with error value?) 378 379 my $fedora_home = $ENV{'FEDORA_HOME'}; 379 my $base_path = & util::filename_cat($fedora_home, "tomcat", "conf", "Catalina");380 381 my $host_path = & util::filename_cat($base_path, $fedora_host);382 my $xmlFile = & util::filename_cat($host_path, "fedora.xml");380 my $base_path = &FileUtils::filenameConcatenate($fedora_home, "tomcat", "conf", "Catalina"); 381 382 my $host_path = &FileUtils::filenameConcatenate($base_path, $fedora_host); 383 my $xmlFile = &FileUtils::filenameConcatenate($host_path, "fedora.xml"); 383 384 if (!-e $xmlFile) { 384 385 # check if the folder localhost contains fedoraXML 385 $host_path = & util::filename_cat($base_path, "localhost");386 $xmlFile = & util::filename_cat($host_path, "fedora.xml");386 $host_path = &FileUtils::filenameConcatenate($base_path, "localhost"); 387 $xmlFile = &FileUtils::filenameConcatenate($host_path, "fedora.xml"); 387 388 if(!-e $xmlFile) { 388 389 # try putting gsdl in this folder, but still print a warning … … 405 406 # 3. If there is already a gsdl.xml file in host_path, compare the string we 406 407 # want to write with what is already in there. If they're the same, we can return 407 $xmlFile = & util::filename_cat($host_path, "gsdl.xml");408 $xmlFile = &FileUtils::filenameConcatenate($host_path, "gsdl.xml"); 408 409 if(-e $xmlFile) { 409 410 # such a file exists, so read the contents … … 428 429 # a. First stop the fedora server 429 430 my $script_ext = ($ENV{'GSDLOS'} =~ m/^windows/) ? ".bat" : ".sh"; 430 my $stop_tomcat = & util::filename_cat($fedora_home, "tomcat", "bin", "shutdown".$script_ext);431 my $stop_tomcat = &FileUtils::filenameConcatenate($fedora_home, "tomcat", "bin", "shutdown".$script_ext); 431 432 # execute the command 432 433 $! = 0; # does this initialise the return value? … … 447 448 448 449 # c. Restart the fedora server 449 my $start_tomcat = & util::filename_cat($fedora_home, "tomcat", "bin", "startup".$script_ext);450 my $start_tomcat = &FileUtils::filenameConcatenate($fedora_home, "tomcat", "bin", "startup".$script_ext); 450 451 $! = 0; 451 452 $status = system($start_tomcat); … … 458 459 $ENV{'CATALINA_HOME'} = $gs_catalina_home if defined $gs_catalina_home; 459 460 461 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 462 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 463 460 464 # Starting up the Fedora server takes a long time. We need to wait for the server to be 461 465 # ready before import can continue, because g2f-import relies on an up-and-running Fedora -
main/trunk/greenstone2/perllib/giget.pm
r24601 r28560 80 80 81 81 if ((!-e $downloadto_fname) || (-z $downloadto_fname)) { 82 83 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 84 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 85 82 86 my $cmd = "wget -nv -T 10 -nc -U \"Mozilla\" -O \"$downloadto_fname\" \"$full_url\""; 83 87 ## print STDERR "*** wget cmd:\n $cmd\n"; -
main/trunk/greenstone2/perllib/plugins/LOMPlugin.pm
r24971 r28560 37 37 use MetadataRead; 38 38 use util; 39 use FileUtils; 39 40 use XMLParser; 40 41 use Cwd; … … 582 583 my $output_dir = $self->{'output_dir'}; 583 584 584 $output_dir = & util::filename_cat($output_dir,"_gsdldown.all");585 $output_dir = &FileUtils::filenameConcatenate($output_dir,"_gsdldown.all"); 585 586 586 587 if (! -d $output_dir) { … … 596 597 $file_url .= "index.html" if ($file_url =~ m/\/$/); 597 598 598 my $full_file_url = & util::filename_cat($output_dir,$file_url);599 my $full_file_url = &FileUtils::filenameConcatenate($output_dir,$file_url); 599 600 # the path to srcdoc will be used later in extrametadata to associate 600 601 # the lom metadata with the document. Needs to be relative to current 601 602 # directory. 602 my $srcdoc_path = & util::filename_cat("_gsdldown.all", $file_url);603 my $srcdoc_path = &FileUtils::filenameConcatenate("_gsdldown.all", $file_url); 603 604 my $check_timestamp = $self->{'check_timestamp'}; 604 605 my $status; … … 628 629 } 629 630 ##print STDERR "**** wget = $wget_cmd\n"; 630 631 632 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 633 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 631 634 632 635 $status = system($wget_cmd); -
main/trunk/greenstone2/perllib/plugins/MediaWikiPlugin.pm
r19123 r28560 35 35 use HTMLPlugin; 36 36 use unicode; 37 use util; 38 use FileUtils; 37 39 38 40 use strict; # every perl program should have this! … … 218 220 $css_files[$css_file_count++] = $2 if defined $2; 219 221 } 222 223 # Set the env for wget once, outside the for loop 224 # the wget binary is dependent on the gnomelib_env (particularly lib/libiconv2.dylib) being set, particularly on Mac Lions (android too?) 225 &util::set_gnomelib_env(); # this will set the gnomelib env once for each subshell launched, by first checking if GEXTGNOME is not already set 220 226 221 227 # download the stylesheets if we haven't downloaded them yet … … 238 244 $css_file =~ s/\?(.+)$//isg; 239 245 240 my $css_file_path = & util::filename_cat($base_dir, $css_file);246 my $css_file_path = &FileUtils::filenameConcatenate($base_dir, $css_file); 241 247 242 248 # do nothing if we have already downloaded the css files … … 251 257 mkdir($path_check) if (! -d $path_check ); 252 258 } 253 259 254 260 # NOTE: wget needs configuration to directly access Internet 255 261 # These files should already downloaded if we used the MediaWikiDownload … … 293 299 $style_dir =~ s/import$/style/; 294 300 $css_file =~ m/(.*)\/(.*)$/; 295 $style_dir = & util::filename_cat($style_dir, $2);301 $style_dir = &FileUtils::filenameConcatenate($style_dir, $2); 296 302 297 303 if(open(OUTPUT, ">$style_dir")){ … … 477 483 my $macro_path = $base_dir; 478 484 $macro_path =~ s/import$/macros/; 479 my $extradm_file = & util::filename_cat($macro_path, "extra.dm");485 my $extradm_file = &FileUtils::filenameConcatenate($macro_path, "extra.dm"); 480 486 481 487 my $extra_dm = ""; … … 644 650 my $self = shift(@_); 645 651 646 my $about_macro_file = & util::filename_cat($ENV{'GSDLHOME'}, "macros", "about.dm");652 my $about_macro_file = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "macros", "about.dm"); 647 653 my $about_page_content = ""; 648 654 if (open(INPUT, "<$about_macro_file")){ -
main/trunk/greenstone2/perllib/util.pm
r28460 r28560 1650 1650 } 1651 1651 1652 # Sets the gnomelib_env. Based on the logic in wvware.pl which can perhaps be replaced with a call to this function in future 1653 sub set_gnomelib_env 1654 { 1655 ## SET THE ENVIRONMENT AS DONE IN SETUP.BASH/BAT OF GNOME-LIB 1656 # Though this is only needed for darwin Lion at this point (and android, though that is untested) 1657 1658 my $env_vars=""; 1659 1660 my $libext = "so"; 1661 if ($ENV{'GSDLOS'} =~ m/^windows$/i) { 1662 #return $env_vars; 1663 return; 1664 } elsif ($ENV{'GSDLOS'} =~ m/^darwin$/i) { 1665 $libext = "dylib"; 1666 } 1667 1668 if (!defined $ENV{'GEXTGNOME'}) { 1669 ##print STDERR "@@@ Setting GEXTGNOME env\n"; 1670 1671 my $gnome_dir = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"ext","gnome-lib-minimal"); 1672 1673 if(! -d $gnome_dir) { 1674 $gnome_dir = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'},"ext","gnome-lib"); 1675 1676 if(! -d $gnome_dir) { 1677 $gnome_dir = ""; 1678 } 1679 } 1680 1681 # now set other the related env vars, 1682 # IF we've found the gnome-lib dir installed in the ext folder 1683 1684 if ($gnome_dir ne "" && -f &FileUtils::filenameConcatenate($gnome_dir, $ENV{'GSDLOS'}, "lib", "libiconv.$libext")) { 1685 $ENV{'GEXTGNOME'} = $gnome_dir; 1686 $ENV{'GEXTGNOME_INSTALLED'}=&FileUtils::filenameConcatenate($ENV{'GEXTGNOME'}, $ENV{'GSDLOS'}); 1687 1688 my $gnomelib_bin = &FileUtils::filenameConcatenate($ENV{'GEXTGNOME_INSTALLED'}, "bin"); 1689 if(-d $gnomelib_bin) { # no bin subfolder in GS binary's cutdown gnome-lib-minimal folder 1690 &util::envvar_prepend("PATH", $gnomelib_bin); 1691 #$env_vars = "export PATH=".$ENV{'PATH'}.";"; 1692 } 1693 1694 # util's prepend will create LD/DYLD_LIB_PATH if it doesn't exist yet 1695 my $gextlib = &FileUtils::filenameConcatenate($ENV{'GEXTGNOME_INSTALLED'}, "lib"); 1696 1697 if($ENV{'GSDLOS'} eq "linux") { 1698 &util::envvar_prepend("LD_LIBRARY_PATH", $gextlib); 1699 #$env_vars .= "export LD_LIBRARY_PATH=".$ENV{'LD_LIBRARY_PATH'}; 1700 } 1701 elsif ($ENV{'GSDLOS'} eq "darwin") { 1702 #&util::envvar_prepend("DYLD_LIBRARY_PATH", $gextlib); 1703 &util::envvar_prepend("DYLD_FALLBACK_LIBRARY_PATH", $gextlib); 1704 #$env_vars .= "export DYLD_FALLBACK_LIBRARY_PATH=".$ENV{'DYLD_FALLBACK_LIBRARY_PATH'}; 1705 } 1706 } 1707 1708 # Above largely mimics the setup.bash of the gnome-lib-minimal. 1709 # Not doing the devel-srcpack that gnome-lib-minimal's setup.bash used to set 1710 # Not exporting GSDLEXTS variable either 1711 } 1712 1713 # print STDERR "@@@@@ GEXTGNOME: ".$ENV{'GEXTGNOME'}."\n\tINSTALL".$ENV{'GEXTGNOME_INSTALLED'}."\n"; 1714 # print STDERR "\tPATH".$ENV{'PATH'}."\n"; 1715 # print STDERR "\tLD_LIB_PATH".$ENV{'LD_LIBRARY_PATH'}."\n" if $ENV{'LD_LIBRARY_PATH}; 1716 # print STDERR "\tDYLD_FALLBACK_LIB_PATH".$ENV{'DYLD_FALLBACK_LIBRARY_PATH'}."\n" if $ENV{'DYLD_FALLBACK_LIBRARY_PATH}; 1717 1718 # if no GEXTGNOME, maybe users didn't need gnome-lib to run gnomelib/libiconv dependent binaries like hashfile, suffix, wget 1719 # (wvware is launched in a gnomelib env from its own script, but could possibly go through this script in future) 1720 1721 #return $env_vars; #print STDOUT $env_vars; 1722 } 1723 1724 1652 1725 1653 1726 ## @function augmentINC()
Note:
See TracChangeset
for help on using the changeset viewer.