Ignore:
Timestamp:
2011-05-26T14:45:49+12:00 (13 years ago)
Author:
sjm84
Message:

Fixing issues with perl finding the wrong perl by making sure it uses the one that is currently running

File:
1 edited

Legend:

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

    r23473 r24093  
    4747    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
    4848    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
     49
     50    if(!$ENV{'PERLPATH'}) {
     51    my $full_perl_exec = $^X;
     52    require File::Basename;
     53    my $perl_path = File::Basename::dirname($full_perl_exec);
     54    $ENV{'PERLPATH'} = $perl_path;
     55    }
     56
    4957}
    5058
     
    5462use util;
    5563use Cwd;
    56 use File::Basename;
    5764
    5865# Are we running on WinNT or Win2000 (or later)?
     
    406413    # formulate the command
    407414    my $cmd = "";
    408     $cmd .= "perl -S ppttohtml.pl ";
     415    $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl");
     416    $cmd .= "$full_perl_path -S ppttohtml.pl ";
    409417    $cmd .= " \"$input_filename\" \"$output_filestem.html\"";
    410418    $cmd .= " 2>\"$output_filestem.err\""
     
    439447    # formulate the command
    440448    my $cmd = "";
    441     $cmd .= "perl -S xlstohtml.pl ";
     449    $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl");
     450    $cmd .= "$full_perl_perl -S xlstohtml.pl ";
    442451    $cmd .= " \"$input_filename\" \"$output_filestem.html\"";
    443452    $cmd .= " 2>\"$output_filestem.err\""
     
    977986    my $cmd = "";
    978987    if ($timeout) {$cmd = "ulimit -t $timeout;";}
    979     $cmd .= "perl -S pdftohtml.pl -zoom $pdf_zoom";
     988    $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl");
     989    $cmd .= "$full_perl_path -S pdftohtml.pl -zoom $pdf_zoom";
    980990    $cmd .= " -c" if ($pdf_complex);
    981991    $cmd .= " -i" if ($pdf_ignore_images);
     
    10511061    if ($timeout) {$cmd = "ulimit -t $timeout;";}
    10521062    $output_type =~ s/.*\_(.*)/$1/i;
    1053     $cmd .= "perl -S pdfpstoimg.pl -convert_to $output_type \"$input_filename\" \"$output_filestem\"";
     1063    $full_perl_path = &util::filename_cat($ENV{'PERLPATH'},"perl");
     1064    $cmd .= "$full_perl_perl -S pdfpstoimg.pl -convert_to $output_type \"$input_filename\" \"$output_filestem\"";
    10541065    if ($ENV{'GSDLOS'} !~ m/^windows$/i || $is_winnt_2000) {
    10551066    $cmd .= " > \"$output_filestem.out\" 2> \"$output_filestem.err\"";
Note: See TracChangeset for help on using the changeset viewer.