Changeset 24192


Ignore:
Timestamp:
06/22/11 17:39:13 (10 years ago)
Author:
ak19
Message:

Sam discovered that using dollar-Config{perlpath} in place of dollar-hat-X is the better way to obtain the path to the perl that is being used. We hope this will not be a relative path on the Mac as dollar-hat-x was on Professor Witten's Mac when we tried it there today.

Location:
main/trunk/greenstone2
Files:
18 edited

Legend:

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

    r24125 r24192  
    4343use FileHandle;
    4444use File::Copy;
     45use Config; # for getting the perlpath in the recommended way
    4546
    4647BEGIN {
     
    276277        #       option was given to build)
    277278
    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";
     279        #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     280        my $download_cmd = "\"$Config{perlpath}\" -S gsWget.pl -P \"$importdir\" -np -nv";
    280281        $download_cmd .= " -r -N -l inf -R \"*\\?*\"";
    281282        $download_cmd .= " -o \"$outfile.download\"" if $use_out;
     
    326327        if (-e $download_dir) {
    327328            # copy download_dir and all it contains to the import directory
    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";
     329            #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     330            my $download_cmd = "\"$Config{perlpath}\" -S filecopy.pl";
    330331            $download_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/;
    331332            $download_cmd .= " -site \"$site\"" if $site =~ /\w/;
     
    466467    print $out "importing the $collection collection\n\n";
    467468
    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";
     469    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     470    my $import_cmd = "\"$Config{perlpath}\" -S import.pl";
    470471    $import_cmd .= " -out \"$outfile.import\"" if $use_out;
    471472    if ($append) {
     
    513514    print $out "building the $collection collection\n\n";
    514515
    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";
     516    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     517    my $build_cmd = "\"$Config{perlpath}\" -S buildcol.pl";
    517518
    518519    my $removeold = 1;
  • main/trunk/greenstone2/bin/script/full-buildcol.pl

    r24125 r24192  
    3535
    3636use strict;
     37use Config; # for getting the perlpath in the recommended way
    3738
    3839my $quoted_argv = join(" ", map { "\"$_\"" } @ARGV);
     
    4849    }
    4950} else {
    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";
     51    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     52    $buildcol_cmd = "\"$Config{perlpath}\" -S $buildcol_cmd";
    5253}
    5354
  • main/trunk/greenstone2/bin/script/full-import.pl

    r24125 r24192  
    3636
    3737use strict;
     38use Config; # for getting the perlpath in the recommended way
    3839
    3940my $quoted_argv = join(" ", map { "\"$_\"" } @ARGV);
     
    4849    }
    4950} else {
    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";
     51    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     52    $import_cmd = "\"$Config{perlpath}\" -S $import_cmd";
    5253}
    5354
  • main/trunk/greenstone2/bin/script/full-rebuild.pl

    r24125 r24192  
    4242use strict;
    4343
     44use Config; # for getting the perlpath in the recommended way
    4445use util;
     46
    4547
    4648sub main
     
    112114    }
    113115    } else {
    114     #$^X is a special variable containing the full path to the current perl executable we are in
    115     $launch_cmd = "\"$^X\" -S ";
     116    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     117    $launch_cmd = "\"$Config{perlpath}\" -S ";
    116118    }
    117119   
  • main/trunk/greenstone2/bin/script/gsConvert.pl

    r24169 r24192  
    4949
    5050    if(!$ENV{'PERLPATH'}) {
    51     my $full_perl_exec = $^X;
     51    my $full_perl_exec = $Config{perlpath}; #$^X;
    5252    require File::Basename;
    5353    my $perl_path = File::Basename::dirname($full_perl_exec);
     
    6262use util;
    6363use Cwd;
     64use Config; # for getting the perlpath in the recommended way
     65# Note: even though this (and other) use statement comes after its
     66# usage in BEGIN, the use statement is in fact executed before BEGIN.
     67
    6468
    6569# Are we running on WinNT or Win2000 (or later)?
  • main/trunk/greenstone2/bin/script/gti.pl

    r24125 r24192  
    3333
    3434    if(!$ENV{'PERLPATH'}) {
    35     my $full_perl_exec = $^X;
     35    my $full_perl_exec = $Config{perlpath}; #$^X;
    3636    require File::Basename;
    3737    my $perl_path = File::Basename::dirname($full_perl_exec);
     
    4343use strict;
    4444use util;
     45use Config; # for getting the perlpath (above!) in the recommended way
    4546
    4647
  • main/trunk/greenstone2/bin/script/incremental-buildcol.pl

    r24125 r24192  
    4242no strict 'subs'; # allow barewords (eg STDERR) as function arguments
    4343
     44use Config; # for getting the perlpath in the recommended way
    4445use util;
    4546use colcfg;
     
    111112    }
    112113    } else {
    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";
     114    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     115    $buildcol_cmd = "\"$Config{perlpath}\" -S $buildcol_cmd";
    115116    }
    116117
  • main/trunk/greenstone2/bin/script/incremental-import-onlyadd.pl

    r24125 r24192  
    4141use strict;
    4242
     43use Config; # for getting the perlpath in the recommended way
    4344use dbutil;
    4445use util;
     
    118119    }
    119120    } else {
    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";
     121    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     122    $import_cmd = "\"$Config{perlpath}\" -S $import_cmd";
    122123    }
    123124
  • main/trunk/greenstone2/bin/script/incremental-import.pl

    r24125 r24192  
    4141use strict;
    4242
     43use Config; # for getting the perlpath in the recommended way
    4344use dbutil;
    4445use util;
     
    138139    }
    139140    } else {
    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";
     141    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     142    $import_cmd = "\"$Config{perlpath}\" -S $import_cmd";
    142143    }
    143144
  • main/trunk/greenstone2/bin/script/incremental-rebuild.pl

    r24125 r24192  
    4242use strict;
    4343
     44use Config; # for getting the perlpath in the recommended way
    4445use util;
    4546
     
    9394    }
    9495    } else {
    95     #$^X is a special variable containing the full path to the current perl executable we are in
    96     $launch_cmd = "\"$^X\" -S ";
     96    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     97    $launch_cmd = "\"$Config{perlpath}\" -S ";
    9798    }
    9899
  • main/trunk/greenstone2/bin/script/mirror.pl

    r24125 r24192  
    4848}
    4949
     50use Config; # for getting the perlpath in the recommended way
    5051use arcinfo;
    5152use colcfg;
     
    116117    # run the mirror program from the import directory
    117118    my  $cmd = "cd $importdir; ";
    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";
     119    #Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in
     120    $cmd .= "\"$Config{perlpath}\" -S gsw3mir.pl -cfgfile $etcdir/w3mir.cfg";
    120121    # print "\n$cmd\n";
    121122    `$cmd`;
     
    127128    elsif ((-e "$etcdir/wget.cfg") && (-e "$etcdir/wget.url")) {
    128129    $ENV{WGETRC} = "$etcdir/wget.cfg";
    129     my $cmd = "\"$^X\" -S gsWget.pl --input-file=$etcdir/wget.url --directory-prefix=$importdir";
     130    my $cmd = "\"$Config{perlpath}\" -S gsWget.pl --input-file=$etcdir/wget.url --directory-prefix=$importdir";
    130131    system($cmd);
    131132    }
  • main/trunk/greenstone2/perllib/cgiactions/baseaction.pm

    r24126 r24192  
    3030
    3131use inexport;
     32use Config; # for getting the perlpath in the recommended way
    3233
    3334our $authenication_enabled = 0;
     
    433434    my $gsdl_cgi = $self->{'gsdl_cgi'};
    434435
    435     my $sendmail_command = "\"$^X\" -S sendmail.pl";
     436    my $sendmail_command = "\"$Config{perlpath}\" -S sendmail.pl";
    436437    $sendmail_command .= " -to \"" . $mail_to_address . "\"";
    437438    $sendmail_command .= " -from \"" . $mail_from_address . "\"";
     
    462463    $perl_args = "-collectdir \"$collect_dir\" " . $perl_args;
    463464
    464     my $perl_command = "\"$^X\" -S $script $perl_args";
     465    my $perl_command = "\"$Config{perlpath}\" -S $script $perl_args";
    465466
    466467
  • main/trunk/greenstone2/perllib/cgiactions/buildaction.pm

    r24126 r24192  
    3636
    3737use util;
     38use Config; # for getting the perlpath in the recommended way
    3839
    3940BEGIN {
     
    138139
    139140    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    140     my $cmd = "\"$^X\" -S full-import.pl \"$collect\"";
     141    my $cmd = "\"$Config{perlpath}\" -S full-import.pl \"$collect\"";
    141142
    142143    my ($status,$report) = $self->run_build_cmd($cmd);
     
    177178
    178179    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    179     my $cmd = "\"$^X\" -S full-buildcol.pl \"$collect\"";
     180    my $cmd = "\"$Config{perlpath}\" -S full-buildcol.pl \"$collect\"";
    180181
    181182    my ($status,$report) = $self->run_build_cmd($cmd);
     
    215216   
    216217    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    217     my $cmd = "\"$^X\" -S full-rebuild.pl \"$collect\"";
     218    my $cmd = "\"$Config{perlpath}\" -S full-rebuild.pl \"$collect\"";
    218219
    219220    my ($status,$report) = $self->run_build_cmd($cmd);
     
    255256
    256257    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    257     my $cmd = "\"$^X\" -S incremental-import.pl \"$collect\"";
     258    my $cmd = "\"$Config{perlpath}\" -S incremental-import.pl \"$collect\"";
    258259
    259260    my ($status,$report) = $self->run_build_cmd($cmd);
     
    294295
    295296    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    296     my $cmd = "\"$^X\" -S incremental-buildcol.pl \"$collect\"";
     297    my $cmd = "\"$Config{perlpath}\" -S incremental-buildcol.pl \"$collect\"";
    297298
    298299    my ($status,$report) = $self->run_build_cmd($cmd);
     
    333334
    334335    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    335     my $cmd = "\"$^X\" -S incremental-rebuild.pl \"$collect\"";
     336    my $cmd = "\"$Config{perlpath}\" -S incremental-rebuild.pl \"$collect\"";
    336337
    337338    my ($status,$report) = $self->run_build_cmd($cmd);
     
    403404       
    404405        ## my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    405         my $cmd = "\"$^X\" -S incremental-rebuild.pl -manifest \"$manifest_filename\" \"$collect\"";
     406        my $cmd = "\"$Config{perlpath}\" -S incremental-rebuild.pl -manifest \"$manifest_filename\" \"$collect\"";
    406407
    407408        ($status,$report) = $self->run_build_cmd($cmd);
  • main/trunk/greenstone2/perllib/cgiactions/indexaction.pm

    r24126 r24192  
    3131
    3232use cgiactions::baseaction;
    33 
     33use Config; # for getting the perlpath in the recommended way
    3434
    3535
     
    133133
    134134    my $bin_script = &util::filename_cat($gsdl_home,"bin","script");
    135     my $cmd = "\"$^X\" -S full-import.pl \"$collect\"";
     135    my $cmd = "\"$Config{perlpath}\" -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 = "\"$^X\" -S full-buildcol.pl \"$collect\"";
     174    my $cmd = "\"$Config{perlpath}\" -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 = "\"$^X\" -S full-rebuild.pl \"$collect\"";
     213    my $cmd = "\"$Config{perlpath}\" -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 = "\"$^X\" -S incremental-import.pl \"$collect\"";
     253    my $cmd = "\"$Config{perlpath}\" -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 = "\"$^X\" -S incremental-buildcol.pl \"$collect\"";
     294    my $cmd = "\"$Config{perlpath}\" -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 = "\"$^X\" -S incremental-rebuild.pl \"$collect\"";
     331    my $cmd = "\"$Config{perlpath}\" -S incremental-rebuild.pl \"$collect\"";
    332332
    333333    my ($status,$report) = $self->run_build_cmd($cmd);
  • main/trunk/greenstone2/perllib/g2futil.pm

    r24126 r24192  
    1515use strict;
    1616use util;
     17use Config; # for getting the perlpath in the recommended way
    1718
    1819sub run_cmd_old
     
    6364    }
    6465    if (($prog =~ m/.pl$/i) && ($ENV{'GSDLOS'} =~ m/^windows/)) {
    65     $prog ="\"$^X\" -S $prog";
     66    $prog ="\"$Config{perlpath}\" -S $prog";
    6667    }
    6768 
  • main/trunk/greenstone2/perllib/lucenebuilder.pm

    r24126 r24192  
    4444use strict;
    4545no strict 'refs';
    46 
     46use Config; # for getting the perlpath in the recommended way
    4747
    4848sub BEGIN {
     
    8282    else
    8383    {
    84     $self->{'full_lucene_passes_exe'} = "\"$^X\" -S \"$lucene_passes_script\"";
     84    $self->{'full_lucene_passes_exe'} = "\"$Config{perlpath}\" -S \"$lucene_passes_script\"";
    8585    }
    8686
  • main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm

    r24126 r24192  
    4444no strict 'refs'; # allow filehandles to be variables and viceversa
    4545no strict 'subs';
     46use Config; # for getting the perlpath in the recommended way
     47
    4648
    4749sub BEGIN {
     
    277279#    }
    278280
    279     my $cmd = "\"$^X\" -S gsConvert.pl -verbose $verbosity ";
     281    my $cmd = "\"$Config{perlpath}\" -S gsConvert.pl -verbose $verbosity ";
    280282    if (defined $self->{'convert_options'}) {
    281283    $cmd .= $self->{'convert_options'} . " ";
  • main/trunk/greenstone2/perllib/plugins/ConvertToRogPlugin.pm

    r24126 r24192  
    3131use strict;
    3232no strict 'refs'; # allow filehandles to be variables and viceversa
     33use Config; # for getting the perlpath in the recommended way
    3334
    3435sub BEGIN {
     
    121122    # making sure the converter gives us the appropriate output type
    122123    my $output_type = lc($convert_to);
    123     my $cmd = "\"$^X\" -S gsMusicConvert.pl -verbose $verbosity -errlog \"$errlog\" -output $output_type \"$tmp_filename\"";
     124    my $cmd = "\"$Config{perlpath}\" -S gsMusicConvert.pl -verbose $verbosity -errlog \"$errlog\" -output $output_type \"$tmp_filename\"";
    124125    $output_type = `$cmd`;
    125126
Note: See TracChangeset for help on using the changeset viewer.