Ignore:
Timestamp:
2011-06-08T16:46:34+12:00 (13 years ago)
Author:
ak19
Message:

Sam and I fixed decided all calls to perl -S from within perl needed to use the special dollar-caret-X variable to refer to the particular perl installation that was also used to run the caller script. This way we have a consistent perl and we know which perlpath works. This variable is moreover embedded in quotes to deal with any spaces in the path to the perl installation.

Location:
main/trunk/greenstone2/perllib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/baseaction.pm

    r23767 r24126  
    433433    my $gsdl_cgi = $self->{'gsdl_cgi'};
    434434
    435     my $sendmail_command = "perl -S sendmail.pl";
     435    my $sendmail_command = "\"$^X\" -S sendmail.pl";
    436436    $sendmail_command .= " -to \"" . $mail_to_address . "\"";
    437437    $sendmail_command .= " -from \"" . $mail_from_address . "\"";
     
    462462    $perl_args = "-collectdir \"$collect_dir\" " . $perl_args;
    463463
    464     my $perl_command = "perl -S $script $perl_args";
     464    my $perl_command = "\"$^X\" -S $script $perl_args";
    465465
    466466
  • main/trunk/greenstone2/perllib/cgiactions/buildaction.pm

    r24071 r24126  
    138138
    139139    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    140     my $cmd = "perl -S full-import.pl \"$collect\"";
     140    my $cmd = "\"$^X\" -S full-import.pl \"$collect\"";
    141141
    142142    my ($status,$report) = $self->run_build_cmd($cmd);
     
    177177
    178178    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    179     my $cmd = "perl -S full-buildcol.pl \"$collect\"";
     179    my $cmd = "\"$^X\" -S full-buildcol.pl \"$collect\"";
    180180
    181181    my ($status,$report) = $self->run_build_cmd($cmd);
     
    215215   
    216216    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    217     my $cmd = "perl -S full-rebuild.pl \"$collect\"";
     217    my $cmd = "\"$^X\" -S full-rebuild.pl \"$collect\"";
    218218
    219219    my ($status,$report) = $self->run_build_cmd($cmd);
     
    255255
    256256    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    257     my $cmd = "perl -S incremental-import.pl \"$collect\"";
     257    my $cmd = "\"$^X\" -S incremental-import.pl \"$collect\"";
    258258
    259259    my ($status,$report) = $self->run_build_cmd($cmd);
     
    294294
    295295    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    296     my $cmd = "perl -S incremental-buildcol.pl \"$collect\"";
     296    my $cmd = "\"$^X\" -S incremental-buildcol.pl \"$collect\"";
    297297
    298298    my ($status,$report) = $self->run_build_cmd($cmd);
     
    333333
    334334    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    335     my $cmd = "perl -S incremental-rebuild.pl \"$collect\"";
     335    my $cmd = "\"$^X\" -S incremental-rebuild.pl \"$collect\"";
    336336
    337337    my ($status,$report) = $self->run_build_cmd($cmd);
     
    403403       
    404404        ## my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    405         my $cmd = "perl -S incremental-rebuild.pl -manifest \"$manifest_filename\" \"$collect\"";
     405        my $cmd = "\"$^X\" -S incremental-rebuild.pl -manifest \"$manifest_filename\" \"$collect\"";
    406406
    407407        ($status,$report) = $self->run_build_cmd($cmd);
  • main/trunk/greenstone2/perllib/cgiactions/indexaction.pm

    r23479 r24126  
    133133
    134134    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    135     my $cmd = "perl -S full-import.pl \"$collect\"";
     135    my $cmd = "\"$^X\" -S full-import.pl \"$collect\"";
    136136
    137137    my ($status,$report) = $self->run_build_cmd($cmd);
     
    172172
    173173    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    174     my $cmd = "perl -S full-buildcol.pl \"$collect\"";
     174    my $cmd = "\"$^X\" -S full-buildcol.pl \"$collect\"";
    175175
    176176    my ($status,$report) = $self->run_build_cmd($cmd);
     
    211211
    212212    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    213     my $cmd = "perl -S full-rebuild.pl \"$collect\"";
     213    my $cmd = "\"$^X\" -S full-rebuild.pl \"$collect\"";
    214214
    215215    my ($status,$report) = $self->run_build_cmd($cmd);
     
    251251
    252252    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    253     my $cmd = "perl -S incremental-import.pl \"$collect\"";
     253    my $cmd = "\"$^X\" -S incremental-import.pl \"$collect\"";
    254254
    255255    my ($status,$report) = $self->run_build_cmd($cmd);
     
    292292
    293293    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    294     my $cmd = "perl -S incremental-buildcol.pl \"$collect\"";
     294    my $cmd = "\"$^X\" -S incremental-buildcol.pl \"$collect\"";
    295295
    296296    my ($status,$report) = $self->run_build_cmd($cmd);
     
    329329    $self->lock_collection($username, $collect);
    330330
    331     my $cmd = "perl -S incremental-rebuild.pl \"$collect\"";
     331    my $cmd = "\"$^X\" -S incremental-rebuild.pl \"$collect\"";
    332332
    333333    my ($status,$report) = $self->run_build_cmd($cmd);
  • main/trunk/greenstone2/perllib/g2futil.pm

    r21719 r24126  
    6363    }
    6464    if (($prog =~ m/.pl$/i) && ($ENV{'GSDLOS'} =~ m/^windows/)) {
    65     $prog ="perl -S $prog";
     65    $prog ="\"$^X\" -S $prog";
    6666    }
    6767 
  • main/trunk/greenstone2/perllib/lucenebuilder.pm

    r21621 r24126  
    8282    else
    8383    {
    84     $self->{'full_lucene_passes_exe'} = "perl -S \"$lucene_passes_script\"";
     84    $self->{'full_lucene_passes_exe'} = "\"$^X\" -S \"$lucene_passes_script\"";
    8585    }
    8686
  • main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm

    r23387 r24126  
    277277#    }
    278278
    279     my $cmd = "perl -S gsConvert.pl -verbose $verbosity ";
     279    my $cmd = "\"$^X\" -S gsConvert.pl -verbose $verbosity ";
    280280    if (defined $self->{'convert_options'}) {
    281281    $cmd .= $self->{'convert_options'} . " ";
  • main/trunk/greenstone2/perllib/plugins/ConvertToRogPlugin.pm

    r23352 r24126  
    121121    # making sure the converter gives us the appropriate output type
    122122    my $output_type = lc($convert_to);
    123     my $cmd = "perl -S gsMusicConvert.pl -verbose $verbosity -errlog \"$errlog\" -output $output_type \"$tmp_filename\"";
     123    my $cmd = "\"$^X\" -S gsMusicConvert.pl -verbose $verbosity -errlog \"$errlog\" -output $output_type \"$tmp_filename\"";
    124124    $output_type = `$cmd`;
    125125
Note: See TracChangeset for help on using the changeset viewer.