Changeset 24093


Ignore:
Timestamp:
05/26/11 14:45:49 (10 years ago)
Author:
sjm84
Message:

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

Location:
main/trunk/greenstone2/bin/script
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/build

    r23313 r24093  
    276276        #       option was given to build)
    277277
    278         my $download_cmd = "perl -S gsWget.pl -P \"$importdir\" -np -nv";
     278        #$^X is a special variable containing the full path to the current perl executable we are in
     279        my $download_cmd = "$^X -S gsWget.pl -P \"$importdir\" -np -nv";
    279280        $download_cmd .= " -r -N -l inf -R \"*\\?*\"";
    280281        $download_cmd .= " -o \"$outfile.download\"" if $use_out;
     
    325326        if (-e $download_dir) {
    326327            # copy download_dir and all it contains to the import directory
    327             my $download_cmd = "perl -S filecopy.pl";
     328            #$^X is a special variable containing the full path to the current perl executable we are in
     329            my $download_cmd = "$^X -S filecopy.pl";
    328330            $download_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/;
    329331            $download_cmd .= " -site \"$site\"" if $site =~ /\w/;
     
    464466    print $out "importing the $collection collection\n\n";
    465467
    466     my $import_cmd = "perl -S import.pl";
     468    #$^X is a special variable containing the full path to the current perl executable we are in
     469    my $import_cmd = "$^X -S import.pl";
    467470    $import_cmd .= " -out \"$outfile.import\"" if $use_out;
    468471    if ($append) {
     
    510513    print $out "building the $collection collection\n\n";
    511514
    512     my $build_cmd = "perl -S buildcol.pl";
     515    #$^X is a special variable containing the full path to the current perl executable we are in
     516    my $build_cmd = "$^X -S buildcol.pl";
    513517
    514518    my $removeold = 1;
  • main/trunk/greenstone2/bin/script/full-buildcol.pl

    r20925 r24093  
    4848    }
    4949} else {
    50     $buildcol_cmd = "perl -S $buildcol_cmd";
     50    #$^X is a special variable containing the full path to the current perl executable we are in
     51    $buildcol_cmd = "$^X -S $buildcol_cmd";
    5152}
    5253
  • main/trunk/greenstone2/bin/script/full-import.pl

    r20925 r24093  
    4848    }
    4949} else {
    50     $import_cmd = "perl -S $import_cmd";
     50    #$^X is a special variable containing the full path to the current perl executable we are in
     51    $import_cmd = "$^X -S $import_cmd";
    5152}
    5253
  • main/trunk/greenstone2/bin/script/full-rebuild.pl

    r20925 r24093  
    112112    }
    113113    } else {
    114     $launch_cmd = "perl -S ";
     114    #$^X is a special variable containing the full path to the current perl executable we are in
     115    $launch_cmd = "$^X -S ";
    115116    }
    116117   
  • 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\"";
  • main/trunk/greenstone2/bin/script/gti.pl

    r18460 r24093  
    3131    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
    3232    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
    33 }
    34 
     33
     34    if(!$ENV{'PERLPATH'}) {
     35    my $full_perl_exec = $^X;
     36    require File::Basename;
     37    my $perl_path = File::Basename::dirname($full_perl_exec);
     38    $ENV{'PERLPATH'} = $perl_path;
     39    }
     40}
    3541
    3642use iso639;
     
    638644
    639645    my $target_filepath = &util::filename_cat($gsdl_root_directory, $target_file);
    640     my $cmd = "/opt/jdk1.6.0/bin/java -cp $classpath:$classpath/xalan.jar ApplyXSLT $target_language_code $gen_many_html_xsl_filepath $target_filepath | perl -S $split_script_filepath $target_file_directory";
     646    my $perl_exec = &util::filename_cat($ENV{'PERLPATH'}, "perl");
     647    my $java_exec = "java";
     648    if(defined($ENV{'JAVA_HOME'}) && $ENV{'JAVA_HOME'} ne ""){
     649    $java_exec = &util::filename_cat($ENV{'JAVA_HOME'}, "bin", "java");
     650    }
     651
     652    my $cmd = "$java_exec -cp $classpath:$classpath/xalan.jar ApplyXSLT $target_language_code $gen_many_html_xsl_filepath $target_filepath | $perl_exec -S $split_script_filepath $target_file_directory";
    641653    my $response = `$cmd`;
    642654    &log_message($cmd);
     
    644656    &log_message("Created HTML operational files");
    645657   
    646     $cmd = "/opt/jdk1.6.0/bin/java -cp $classpath:$classpath/xalan.jar ApplyXSLT $target_language_code $gen_index_xml_xsl_filepath $target_filepath > " . $target_file_directory . "help_index.xml"; # 2>/dev/null";
     658    $cmd = "$java_exec -cp $classpath:$classpath/xalan.jar ApplyXSLT $target_language_code $gen_index_xml_xsl_filepath $target_filepath > " . $target_file_directory . "help_index.xml"; # 2>/dev/null";
    647659    $response = `$cmd`;
    648660    &log_message($cmd);
  • main/trunk/greenstone2/bin/script/incremental-buildcol.pl

    r21733 r24093  
    111111    }
    112112    } else {
    113     $buildcol_cmd = "perl -S $buildcol_cmd";
     113    #$^X is a special variable containing the full path to the current perl executable we are in
     114    $buildcol_cmd = "$^X -S $buildcol_cmd";
    114115    }
    115116
  • main/trunk/greenstone2/bin/script/incremental-import-onlyadd.pl

    r21861 r24093  
    118118    }
    119119    } else {
    120     $import_cmd = "perl -S $import_cmd";
     120    #$^X is a special variable containing the full path to the current perl executable we are in
     121    $import_cmd = "$^X -S $import_cmd";
    121122    }
    122123
  • main/trunk/greenstone2/bin/script/incremental-import.pl

    r23218 r24093  
    138138    }
    139139    } else {
    140     $import_cmd = "perl -S $import_cmd";
     140    #$^X is a special variable containing the full path to the current perl executable we are in
     141    $import_cmd = "$^X -S $import_cmd";
    141142    }
    142143
  • main/trunk/greenstone2/bin/script/incremental-rebuild.pl

    r23192 r24093  
    9393    }
    9494    } else {
    95     $launch_cmd = "perl -S ";
     95    #$^X is a special variable containing the full path to the current perl executable we are in
     96    $launch_cmd = "$^X -S ";
    9697    }
    9798
  • main/trunk/greenstone2/bin/script/mirror.pl

    r13053 r24093  
    116116    # run the mirror program from the import directory
    117117    my  $cmd = "cd $importdir; ";
    118     $cmd .= "perl -S gsw3mir.pl -cfgfile $etcdir/w3mir.cfg";
     118    #$^X is a special variable containing the full path to the current perl executable we are in
     119    $cmd .= "$^X -S gsw3mir.pl -cfgfile $etcdir/w3mir.cfg";
    119120    # print "\n$cmd\n";
    120121    `$cmd`;
     
    126127    elsif ((-e "$etcdir/wget.cfg") && (-e "$etcdir/wget.url")) {
    127128    $ENV{WGETRC} = "$etcdir/wget.cfg";
    128     my $cmd = "perl -S gsWget.pl --input-file=$etcdir/wget.url --directory-prefix=$importdir";
     129    my $cmd = "$^X -S gsWget.pl --input-file=$etcdir/wget.url --directory-prefix=$importdir";
    129130    system($cmd);
    130131    }
Note: See TracChangeset for help on using the changeset viewer.