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/incremental-import-onlyadd.pl

    r24192 r24362  
    3131 
    3232 
    33  
    3433BEGIN { 
    3534    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 
     
    3837} 
    3938 
    40  
    4139use strict; 
    42  
    43 use Config; # for getting the perlpath in the recommended way 
    4440use dbutil; 
    4541use util; 
     
    6056    exit(-1); 
    6157    } 
    62  
    6358 
    6459    my $collection = pop @argv; 
     
    109104    my $quoted_argv = join(" ", map { "\"$_\"" } @filtered_argv); 
    110105     
    111  
    112     my $import_cmd = "import.pl"; 
    113     if($ENV{'PERLPATH'}) { 
    114106    # need to ensure that the path to perl is quoted (in case there's spaces in it) 
    115     if($ENV{'GSDLOS'} =~ m/windows/) { 
    116         $import_cmd = "\"$ENV{'PERLPATH'}\\Perl.exe\" -S $import_cmd"; 
    117     } else { 
    118         $import_cmd = "\"$ENV{'PERLPATH'}/perl\" -S $import_cmd"; 
    119     } 
    120     } else { 
    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"; 
    123     } 
     107    my $import_cmd = "\"".&util::get_perl_exec()."\" -S import.pl"; 
    124108 
    125109    if (-e $archiveinf_doc) { 
    126     $import_cmd .= " -keepold"; 
    127      
     110    $import_cmd .= " -keepold";  
    128111    } 
    129112    else { 
     
    135118 
    136119    $import_cmd .= " $quoted_argv \"$collection\""; 
    137  
    138120     
    139121    my $import_status = system($import_cmd)/256;