Changeset 24362 for main/trunk/greenstone2/perllib
- Timestamp:
- 2011-08-03T21:17:30+12:00 (13 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cgiactions/baseaction.pm
r24192 r24362 28 28 29 29 use strict; 30 30 use util; 31 31 use inexport; 32 use Config; # for getting the perlpath in the recommended way33 32 34 33 our $authenication_enabled = 0; … … 434 433 my $gsdl_cgi = $self->{'gsdl_cgi'}; 435 434 436 my $sendmail_command = "\" $Config{perlpath}\" -S sendmail.pl";435 my $sendmail_command = "\"".&util::get_perl_exec()."\" -S sendmail.pl"; 437 436 $sendmail_command .= " -to \"" . $mail_to_address . "\""; 438 437 $sendmail_command .= " -from \"" . $mail_from_address . "\""; … … 463 462 $perl_args = "-collectdir \"$collect_dir\" " . $perl_args; 464 463 465 my $perl_command = "\" $Config{perlpath}\" -S $script $perl_args";464 my $perl_command = "\"".&util::get_perl_exec()."\" -S $script $perl_args"; 466 465 467 466 -
main/trunk/greenstone2/perllib/cgiactions/buildaction.pm
r24192 r24362 36 36 37 37 use util; 38 use Config; # for getting the perlpath in the recommended way39 38 40 39 BEGIN { … … 139 138 140 139 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 141 my $cmd = "\" $Config{perlpath}\" -S full-import.pl \"$collect\"";140 my $cmd = "\"".&util::get_perl_exec()."\" -S full-import.pl \"$collect\""; 142 141 143 142 my ($status,$report) = $self->run_build_cmd($cmd); … … 178 177 179 178 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 180 my $cmd = "\" $Config{perlpath}\" -S full-buildcol.pl \"$collect\"";179 my $cmd = "\"".&util::get_perl_exec()."\" -S full-buildcol.pl \"$collect\""; 181 180 182 181 my ($status,$report) = $self->run_build_cmd($cmd); … … 216 215 217 216 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 218 my $cmd = "\" $Config{perlpath}\" -S full-rebuild.pl \"$collect\"";217 my $cmd = "\"".&util::get_perl_exec()."\" -S full-rebuild.pl \"$collect\""; 219 218 220 219 my ($status,$report) = $self->run_build_cmd($cmd); … … 256 255 257 256 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 258 my $cmd = "\" $Config{perlpath}\" -S incremental-import.pl \"$collect\"";257 my $cmd = "\"".&util::get_perl_exec()."\" -S incremental-import.pl \"$collect\""; 259 258 260 259 my ($status,$report) = $self->run_build_cmd($cmd); … … 295 294 296 295 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 297 my $cmd = "\" $Config{perlpath}\" -S incremental-buildcol.pl \"$collect\"";296 my $cmd = "\"".&util::get_perl_exec()."\" -S incremental-buildcol.pl \"$collect\""; 298 297 299 298 my ($status,$report) = $self->run_build_cmd($cmd); … … 334 333 335 334 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 336 my $cmd = "\" $Config{perlpath}\" -S incremental-rebuild.pl \"$collect\"";335 my $cmd = "\"".&util::get_perl_exec()."\" -S incremental-rebuild.pl \"$collect\""; 337 336 338 337 my ($status,$report) = $self->run_build_cmd($cmd); … … 404 403 405 404 ## my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 406 my $cmd = "\" $Config{perlpath}\" -S incremental-rebuild.pl -manifest \"$manifest_filename\" \"$collect\"";405 my $cmd = "\"".&util::get_perl_exec()."\" -S incremental-rebuild.pl -manifest \"$manifest_filename\" \"$collect\""; 407 406 408 407 ($status,$report) = $self->run_build_cmd($cmd); -
main/trunk/greenstone2/perllib/cgiactions/indexaction.pm
r24192 r24362 29 29 30 30 use strict; 31 31 use util; 32 32 use cgiactions::baseaction; 33 use Config; # for getting the perlpath in the recommended way34 33 35 34 36 35 @indexaction::ISA = ('baseaction'); 37 38 39 40 41 42 43 36 44 37 # 'a' for action, and 'c' for collection are also compulsorary, and … … 133 126 134 127 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 135 my $cmd = "\" $Config{perlpath}\" -S full-import.pl \"$collect\"";128 my $cmd = "\"".&util::get_perl_exec()."\" -S full-import.pl \"$collect\""; 136 129 137 130 my ($status,$report) = $self->run_build_cmd($cmd); … … 172 165 173 166 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 174 my $cmd = "\" $Config{perlpath}\" -S full-buildcol.pl \"$collect\"";167 my $cmd = "\"".&util::get_perl_exec()."\" -S full-buildcol.pl \"$collect\""; 175 168 176 169 my ($status,$report) = $self->run_build_cmd($cmd); … … 211 204 212 205 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 213 my $cmd = "\" $Config{perlpath}\" -S full-rebuild.pl \"$collect\"";206 my $cmd = "\"".&util::get_perl_exec()."\" -S full-rebuild.pl \"$collect\""; 214 207 215 208 my ($status,$report) = $self->run_build_cmd($cmd); … … 251 244 252 245 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 253 my $cmd = "\" $Config{perlpath}\" -S incremental-import.pl \"$collect\"";246 my $cmd = "\"".&util::get_perl_exec()."\" -S incremental-import.pl \"$collect\""; 254 247 255 248 my ($status,$report) = $self->run_build_cmd($cmd); … … 292 285 293 286 my $bin_script = &util::filename_cat($gsdl_home,"bin","script"); 294 my $cmd = "\" $Config{perlpath}\" -S incremental-buildcol.pl \"$collect\"";287 my $cmd = "\"".&util::get_perl_exec()."\" -S incremental-buildcol.pl \"$collect\""; 295 288 296 289 my ($status,$report) = $self->run_build_cmd($cmd); … … 329 322 $self->lock_collection($username, $collect); 330 323 331 my $cmd = "\" $Config{perlpath}\" -S incremental-rebuild.pl \"$collect\"";324 my $cmd = "\"".&util::get_perl_exec()."\" -S incremental-rebuild.pl \"$collect\""; 332 325 333 326 my ($status,$report) = $self->run_build_cmd($cmd); -
main/trunk/greenstone2/perllib/g2futil.pm
r24192 r24362 15 15 use strict; 16 16 use util; 17 use Config; # for getting the perlpath in the recommended way18 17 19 18 sub run_cmd_old … … 31 30 32 31 if ($verbosity >= 2) { 33 print "Run ing command:\n";32 print "Running command:\n"; 34 33 print "$cmd\n"; 35 34 } … … 64 63 } 65 64 if (($prog =~ m/.pl$/i) && ($ENV{'GSDLOS'} =~ m/^windows/)) { 66 $prog ="\" $Config{perlpath}\" -S $prog";65 $prog ="\"".&util::get_perl_exec()."\" -S $prog"; 67 66 } 68 67 -
main/trunk/greenstone2/perllib/lucenebuilder.pm
r24192 r24362 44 44 use strict; 45 45 no strict 'refs'; 46 use Config; # for getting the perlpath in the recommended way46 use util; 47 47 48 48 sub BEGIN { … … 82 82 else 83 83 { 84 $self->{'full_lucene_passes_exe'} = "\" $Config{perlpath}\" -S \"$lucene_passes_script\"";84 $self->{'full_lucene_passes_exe'} = "\"".&util::get_perl_exec()."\" -S \"$lucene_passes_script\""; 85 85 } 86 86 -
main/trunk/greenstone2/perllib/plugins/ConvertBinaryFile.pm
r24360 r24362 44 44 no strict 'refs'; # allow filehandles to be variables and viceversa 45 45 no strict 'subs'; 46 use Config; # for getting the perlpath in the recommended way46 use util; 47 47 48 48 … … 279 279 # } 280 280 281 my $cmd = "\" $Config{perlpath}\" -S gsConvert.pl -verbose $verbosity ";281 my $cmd = "\"".&util::get_perl_exec()."\" -S gsConvert.pl -verbose $verbosity "; 282 282 if (defined $self->{'convert_options'}) { 283 283 $cmd .= $self->{'convert_options'} . " "; -
main/trunk/greenstone2/perllib/plugins/ConvertToRogPlugin.pm
r24225 r24362 31 31 use strict; 32 32 no strict 'refs'; # allow filehandles to be variables and viceversa 33 use Config; # for getting the perlpath in the recommended way33 use util; 34 34 35 35 sub BEGIN { … … 122 122 # making sure the converter gives us the appropriate output type 123 123 my $output_type = lc($convert_to); 124 my $cmd = "\" $Config{perlpath}\" -S gsMusicConvert.pl -verbose $verbosity -errlog \"$errlog\" -output $output_type \"$tmp_filename\"";124 my $cmd = "\"".&util::get_perl_exec()."\" -S gsMusicConvert.pl -verbose $verbosity -errlog \"$errlog\" -output $output_type \"$tmp_filename\""; 125 125 $output_type = `$cmd`; 126 126 -
main/trunk/greenstone2/perllib/util.pm
r24291 r24362 31 31 use File::Copy; 32 32 use File::Basename; 33 # Config for getting the perlpath in the recommended way, though it uses paths that are 34 # hard-coded into the Config file that's generated upon configuring and compiling perl. 35 # $^X works better in some cases to return the path to perl used to launch the script, 36 # but if launched with plain "perl" (no full-path), that will be just what it returns. 37 use Config; 33 38 34 39 # removes files (but not directories) … … 1604 1609 } 1605 1610 1611 sub get_perl_exec() { 1612 my $perl_exec = $^X; # may return just "perl" 1613 1614 if($ENV{'PERLPATH'}) { 1615 # OR: # $perl_exec = &util::filename_cat($ENV{'PERLPATH'},"perl"); 1616 if($ENV{'GSDLOS'} =~ m/windows/) { 1617 $perl_exec = "$ENV{'PERLPATH'}\\Perl.exe"; 1618 } else { 1619 $perl_exec = "$ENV{'PERLPATH'}/perl"; 1620 } 1621 } else { # no PERLPATH, use Config{perlpath} else $^X: special variables 1622 # containing the full path to the current perl executable we're using 1623 $perl_exec = $Config{perlpath}; # configured path for perl 1624 if (!-e $perl_exec) { # may not point to location on this machine 1625 $perl_exec = $^X; # may return just "perl" 1626 if($perl_exec =~ m/^perl/i) { # warn if just perl or Perl.exe 1627 print STDERR "**** WARNING: Perl exec found contains no path: $perl_exec"; 1628 } 1629 } 1630 } 1631 1632 return $perl_exec; 1633 } 1634 1635 1606 1636 1;
Note:
See TracChangeset
for help on using the changeset viewer.