Ignore:
Timestamp:
2013-10-30T20:54:49+13:00 (11 years ago)
Author:
ak19
Message:
  1. New subroutine util::set_gnomelib_env that sets the environment for gnomelib needed for running hashfile, suffix and wget which are dependent on the libiconv dll in ext/gnome-lib(-minimal). It's particularly the Mac Lions that need libiconv.2.dylib. 2. Updated the call to hashfile in doc.pm, the call to suffix in Phind.pm and the calls to wget in several perl scripts and modules to call util::set_gnomelib_env, though this will only set the environment once for each subshell.
Location:
main/trunk/greenstone2/perllib/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/LOMPlugin.pm

    r24971 r28560  
    3737use MetadataRead;
    3838use util;
     39use FileUtils;
    3940use XMLParser;
    4041use Cwd;
     
    582583    my $output_dir = $self->{'output_dir'};
    583584
    584     $output_dir = &util::filename_cat($output_dir,"_gsdldown.all");
     585    $output_dir = &FileUtils::filenameConcatenate($output_dir,"_gsdldown.all");
    585586
    586587    if (! -d $output_dir) {
     
    596597    $file_url .= "index.html" if ($file_url =~ m/\/$/);
    597598
    598     my $full_file_url = &util::filename_cat($output_dir,$file_url);
     599    my $full_file_url = &FileUtils::filenameConcatenate($output_dir,$file_url);
    599600    # the path to srcdoc will be used later in extrametadata to associate
    600601    # the lom metadata with the document. Needs to be relative to current
    601602    # directory.
    602     my $srcdoc_path = &util::filename_cat("_gsdldown.all", $file_url);
     603    my $srcdoc_path = &FileUtils::filenameConcatenate("_gsdldown.all", $file_url);
    603604    my $check_timestamp = $self->{'check_timestamp'};
    604605    my $status;
     
    628629    }
    629630    ##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
    631634   
    632635    $status = system($wget_cmd);
  • main/trunk/greenstone2/perllib/plugins/MediaWikiPlugin.pm

    r19123 r28560  
    3535use HTMLPlugin;
    3636use unicode;
     37use util;
     38use FileUtils;
    3739
    3840use strict; # every perl program should have this!
     
    218220        $css_files[$css_file_count++] = $2 if defined $2;
    219221    }
     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
    220226       
    221227    # download the stylesheets if we haven't downloaded them yet
     
    238244        $css_file =~ s/\?(.+)$//isg; 
    239245       
    240             my $css_file_path = &util::filename_cat($base_dir, $css_file);     
     246            my $css_file_path = &FileUtils::filenameConcatenate($base_dir, $css_file);     
    241247       
    242248        # do nothing if we have already downloaded the css files
     
    251257        mkdir($path_check) if (! -d $path_check );
    252258         }
    253          
     259
    254260             # NOTE: wget needs configuration to directly access Internet
    255261             # These files should already downloaded if we used the MediaWikiDownload             
     
    293299            $style_dir =~ s/import$/style/;
    294300            $css_file =~ m/(.*)\/(.*)$/;
    295             $style_dir = &util::filename_cat($style_dir, $2);           
     301            $style_dir = &FileUtils::filenameConcatenate($style_dir, $2);           
    296302           
    297303            if(open(OUTPUT, ">$style_dir")){   
     
    477483        my $macro_path = $base_dir;
    478484        $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");       
    480486       
    481487        my $extra_dm = "";
     
    644650    my $self = shift(@_);
    645651
    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");
    647653  my $about_page_content = "";
    648654  if (open(INPUT, "<$about_macro_file")){
Note: See TracChangeset for help on using the changeset viewer.