Show
Ignore:
Timestamp:
03.08.2011 21:17:30 (8 years ago)
Author:
ak19
Message:

The method of locating perl has changed once more: util now defines the fuction get_perl_exec which is used by other scripts to obtain the path to the perl executable they should use.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/gsConvert.pl

    r24223 r24362  
    4747    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 
    4848    unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 
    49  
    50     if(!$ENV{'PERLPATH'}) { 
    51     use Config; # for some reason, this can't be a require statement 
    52     my $full_perl_exec = $Config{perlpath}; #$^X;    
    53     require File::Basename; 
    54     my $perl_path = File::Basename::dirname($full_perl_exec); 
    55     $ENV{'PERLPATH'} = $perl_path; 
    56     } 
    57  
    5849} 
    5950 
     
    6354use util; 
    6455use Cwd; 
    65 #use Config; # for getting the perlpath in the recommended way 
    66 # Note: even though this (and other) use statement comes after its 
    67 # usage in BEGIN, the use statement is in fact executed before BEGIN. 
    68 # Doesn't work here for Greenstone 3. 
    69  
    7056 
    7157# Are we running on WinNT or Win2000 (or later)? 
     
    419405    # formulate the command 
    420406    my $cmd = ""; 
    421     my $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl"); 
     407    my $full_perl_path = &util::get_perl_exec(); 
    422408    $cmd .= "\"$full_perl_path\" -S ppttohtml.pl "; 
    423409    $cmd .= " \"$input_filename\" \"$output_filestem.html\""; 
     
    453439    # formulate the command 
    454440    my $cmd = ""; 
    455     my $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl"); 
     441    my $full_perl_path = &util::get_perl_exec(); 
    456442    $cmd .= "\"$full_perl_path\" -S xlstohtml.pl "; 
    457443    $cmd .= " \"$input_filename\" \"$output_filestem.html\""; 
     
    10141000    my $cmd = ""; 
    10151001    if ($timeout) {$cmd = "ulimit -t $timeout;";} 
    1016     my $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl"); 
     1002    my $full_perl_path = &util::get_perl_exec(); 
    10171003    $cmd .= "\"$full_perl_path\" -S pdftohtml.pl -zoom $pdf_zoom"; 
    10181004    $cmd .= " -c" if ($pdf_complex); 
     
    10891075    if ($timeout) {$cmd = "ulimit -t $timeout;";} 
    10901076    $output_type =~ s/.*\_(.*)/$1/i; 
    1091     my $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl"); 
     1077    my $full_perl_path = &util::get_perl_exec(); 
    10921078    $cmd .= "\"$full_perl_path\" -S pdfpstoimg.pl -convert_to $output_type \"$input_filename\" \"$output_filestem\""; 
    10931079    if ($ENV{'GSDLOS'} !~ m/^windows$/i || $is_winnt_2000) {