Changeset 24362 for main/trunk/greenstone2/bin
- Timestamp:
- 2011-08-03T21:17:30+12:00 (13 years ago)
- Location:
- main/trunk/greenstone2/bin/script
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/build
r24192 r24362 43 43 use FileHandle; 44 44 use File::Copy; 45 use Config; # for getting the perlpath in the recommended way46 45 47 46 BEGIN { … … 277 276 # option was given to build) 278 277 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"; 278 my $download_cmd = "\"".&util::get_perl_exec()."\" -S gsWget.pl -P \"$importdir\" -np -nv"; 281 279 $download_cmd .= " -r -N -l inf -R \"*\\?*\""; 282 280 $download_cmd .= " -o \"$outfile.download\"" if $use_out; … … 328 326 # copy download_dir and all it contains to the import directory 329 327 #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";328 my $download_cmd = "\"".&util::get_perl_exec()."\" -S filecopy.pl"; 331 329 $download_cmd .= " -collectdir \"$collectdir\"" if $collectdir =~ /\w/; 332 330 $download_cmd .= " -site \"$site\"" if $site =~ /\w/; … … 468 466 469 467 #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";468 my $import_cmd = "\"".&util::get_perl_exec()."\" -S import.pl"; 471 469 $import_cmd .= " -out \"$outfile.import\"" if $use_out; 472 470 if ($append) { … … 515 513 516 514 #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";515 my $build_cmd = "\"".&util::get_perl_exec()."\" -S buildcol.pl"; 518 516 519 517 my $removeold = 1; -
main/trunk/greenstone2/bin/script/full-buildcol.pl
r24192 r24362 32 32 BEGIN { 33 33 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'}; 34 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 34 35 } 35 36 36 37 use strict; 37 use Config; # for getting the perlpath in the recommended way38 use util; 38 39 39 40 my $quoted_argv = join(" ", map { "\"$_\"" } @ARGV); 40 41 41 42 my $buildcol_cmd = "buildcol.pl -removeold $quoted_argv"; 43 if($ENV{'PERLPATH'}) { 44 # need to ensure that the path to perl is quoted (in case there's spaces in it) 45 if($ENV{'GSDLOS'} =~ m/windows/) { 46 $buildcol_cmd = "\"$ENV{'PERLPATH'}\\Perl.exe\" -S $buildcol_cmd"; 47 } else { 48 $buildcol_cmd = "\"$ENV{'PERLPATH'}/perl\" -S $buildcol_cmd"; 49 } 50 } else { 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"; 53 } 42 my $buildcol_cmd = "\"".&util::get_perl_exec()."\" -S buildcol.pl -removeold $quoted_argv"; 54 43 55 44 my $buildcol_status = system($buildcol_cmd)/256; -
main/trunk/greenstone2/bin/script/full-import.pl
r24192 r24362 33 33 BEGIN { 34 34 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'}; 35 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 35 36 } 36 37 37 38 use strict; 38 use Config; # for getting the perlpath in the recommended way39 use util; 39 40 40 41 my $quoted_argv = join(" ", map { "\"$_\"" } @ARGV); 41 42 42 my $import_cmd = "import.pl -removeold $quoted_argv"; 43 if($ENV{'PERLPATH'}) { 44 # need to ensure that the path to perl is quoted (in case there's spaces in it) 45 if($ENV{'GSDLOS'} =~ m/windows/) { 46 $import_cmd = "\"$ENV{'PERLPATH'}\\Perl.exe\" -S $import_cmd"; 47 } else { 48 $import_cmd = "\"$ENV{'PERLPATH'}/perl\" -S $import_cmd"; 49 } 50 } else { 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"; 53 } 43 # need to ensure that the path to perl is quoted (in case there's spaces in it) 44 my $import_cmd = "\"".&util::get_perl_exec()."\" -S import.pl -removeold $quoted_argv"; 54 45 55 46 my $import_status = system($import_cmd)/256; -
main/trunk/greenstone2/bin/script/full-rebuild.pl
r24192 r24362 39 39 } 40 40 41 42 41 use strict; 43 44 use Config; # for getting the perlpath in the recommended way45 42 use util; 46 43 … … 105 102 my $final_status = 0; 106 103 107 my $launch_cmd = "";108 if($ENV{'PERLPATH'}) {109 104 # need to ensure that the path to perl is quoted (in case there's spaces in it) 110 if($ENV{'GSDLOS'} =~ m/windows/) { 111 $launch_cmd = "\"$ENV{'PERLPATH'}\\Perl.exe\" -S "; 112 } else { 113 $launch_cmd = "\"$ENV{'PERLPATH'}/perl\" -S "; 114 } 115 } else { 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 "; 118 } 105 my $launch_cmd = "\"".&util::get_perl_exec()."\" -S "; 119 106 120 107 print "\n"; -
main/trunk/greenstone2/bin/script/gsConvert.pl
r24223 r24362 47 47 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 48 48 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 49 50 if(!$ENV{'PERLPATH'}) {51 use Config; # for some reason, this can't be a require statement52 my $full_perl_exec = $Config{perlpath}; #$^X;53 require File::Basename;54 my $perl_path = File::Basename::dirname($full_perl_exec);55 $ENV{'PERLPATH'} = $perl_path;56 }57 58 49 } 59 50 … … 63 54 use util; 64 55 use Cwd; 65 #use Config; # for getting the perlpath in the recommended way66 # Note: even though this (and other) use statement comes after its67 # usage in BEGIN, the use statement is in fact executed before BEGIN.68 # Doesn't work here for Greenstone 3.69 70 56 71 57 # Are we running on WinNT or Win2000 (or later)? … … 419 405 # formulate the command 420 406 my $cmd = ""; 421 my $full_perl_path = &util:: filename_cat($ENV{'PERLPATH'},"perl");407 my $full_perl_path = &util::get_perl_exec(); 422 408 $cmd .= "\"$full_perl_path\" -S ppttohtml.pl "; 423 409 $cmd .= " \"$input_filename\" \"$output_filestem.html\""; … … 453 439 # formulate the command 454 440 my $cmd = ""; 455 my $full_perl_path = &util:: filename_cat($ENV{'PERLPATH'},"perl");441 my $full_perl_path = &util::get_perl_exec(); 456 442 $cmd .= "\"$full_perl_path\" -S xlstohtml.pl "; 457 443 $cmd .= " \"$input_filename\" \"$output_filestem.html\""; … … 1014 1000 my $cmd = ""; 1015 1001 if ($timeout) {$cmd = "ulimit -t $timeout;";} 1016 my $full_perl_path = &util:: filename_cat($ENV{'PERLPATH'},"perl");1002 my $full_perl_path = &util::get_perl_exec(); 1017 1003 $cmd .= "\"$full_perl_path\" -S pdftohtml.pl -zoom $pdf_zoom"; 1018 1004 $cmd .= " -c" if ($pdf_complex); … … 1089 1075 if ($timeout) {$cmd = "ulimit -t $timeout;";} 1090 1076 $output_type =~ s/.*\_(.*)/$1/i; 1091 my $full_perl_path = &util:: filename_cat($ENV{'PERLPATH'},"perl");1077 my $full_perl_path = &util::get_perl_exec(); 1092 1078 $cmd .= "\"$full_perl_path\" -S pdfpstoimg.pl -convert_to $output_type \"$input_filename\" \"$output_filestem\""; 1093 1079 if ($ENV{'GSDLOS'} !~ m/^windows$/i || $is_winnt_2000) { -
main/trunk/greenstone2/bin/script/gti.pl
r24223 r24362 31 31 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 32 32 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 33 34 if(!$ENV{'PERLPATH'}) {35 use Config; # for getting the perlpath in the recommended way36 my $full_perl_exec = $Config{perlpath}; #$^X;37 require File::Basename;38 my $perl_path = File::Basename::dirname($full_perl_exec);39 $ENV{'PERLPATH'} = $perl_path;40 }41 33 } 42 34 … … 645 637 646 638 my $target_filepath = &util::filename_cat($gsdl_root_directory, $target_file); 647 my $perl_exec = &util:: filename_cat($ENV{'PERLPATH'}, "perl");639 my $perl_exec = &util::get_perl_exec(); 648 640 my $java_exec = "java"; 649 641 if(defined($ENV{'JAVA_HOME'}) && $ENV{'JAVA_HOME'} ne ""){ -
main/trunk/greenstone2/bin/script/incremental-buildcol.pl
r24192 r24362 42 42 no strict 'subs'; # allow barewords (eg STDERR) as function arguments 43 43 44 use Config; # for getting the perlpath in the recommended way45 44 use util; 46 45 use colcfg; … … 92 91 print STDERR "Unable to use collection \"$collection\" within \"$collect_dir\"\n"; 93 92 exit -1; 94 } 95 93 } 96 94 97 95 if (!defined $build_dir) { … … 103 101 my $quoted_argv = join(" ", map { "\"$_\"" } @filtered_argv); 104 102 105 my $buildcol_cmd = "buildcol.pl"; 106 if($ENV{'PERLPATH'}) { 107 # need to ensure that the path to perl is quoted (in case there's spaces in it) 108 if($ENV{'GSDLOS'} =~ m/windows/) { 109 $buildcol_cmd = "\"$ENV{'PERLPATH'}\\Perl.exe\" -S $buildcol_cmd"; 110 } else { 111 $buildcol_cmd = "\"$ENV{'PERLPATH'}/perl\" -S $buildcol_cmd"; 112 } 113 } else { 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"; 116 } 103 my $buildcol_cmd = "\"".&util::get_perl_exec()."\" -S buildcol.pl"; 117 104 118 105 # Read in the collection configuration file. -
main/trunk/greenstone2/bin/script/incremental-import-onlyadd.pl
r24192 r24362 31 31 32 32 33 34 33 BEGIN { 35 34 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; … … 38 37 } 39 38 40 41 39 use strict; 42 43 use Config; # for getting the perlpath in the recommended way44 40 use dbutil; 45 41 use util; … … 60 56 exit(-1); 61 57 } 62 63 58 64 59 my $collection = pop @argv; … … 109 104 my $quoted_argv = join(" ", map { "\"$_\"" } @filtered_argv); 110 105 111 112 my $import_cmd = "import.pl";113 if($ENV{'PERLPATH'}) {114 106 # 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"; 124 108 125 109 if (-e $archiveinf_doc) { 126 $import_cmd .= " -keepold"; 127 110 $import_cmd .= " -keepold"; 128 111 } 129 112 else { … … 135 118 136 119 $import_cmd .= " $quoted_argv \"$collection\""; 137 138 120 139 121 my $import_status = system($import_cmd)/256; -
main/trunk/greenstone2/bin/script/incremental-import.pl
r24192 r24362 31 31 32 32 33 34 33 BEGIN { 35 34 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; … … 38 37 } 39 38 40 41 39 use strict; 42 43 use Config; # for getting the perlpath in the recommended way44 40 use dbutil; 45 41 use util; … … 60 56 exit(-1); 61 57 } 62 63 58 64 59 my $collection = pop @argv; … … 129 124 my $quoted_argv = join(" ", map { "\"$_\"" } @filtered_argv); 130 125 131 132 my $import_cmd = "import.pl";133 if($ENV{'PERLPATH'}) {134 126 # need to ensure that the path to perl is quoted (in case there's spaces in it) 135 if($ENV{'GSDLOS'} =~ m/windows/) { 136 $import_cmd = "\"$ENV{'PERLPATH'}\\Perl.exe\" -S $import_cmd"; 137 } else { 138 $import_cmd = "\"$ENV{'PERLPATH'}/perl\" -S $import_cmd"; 139 } 140 } else { 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"; 143 } 127 my $import_cmd = "\"".&util::get_perl_exec()."\" -S import.pl"; 144 128 145 129 if (defined $manifest) { -
main/trunk/greenstone2/bin/script/incremental-rebuild.pl
r24192 r24362 39 39 } 40 40 41 42 41 use strict; 43 44 use Config; # for getting the perlpath in the recommended way45 42 use util; 46 43 … … 85 82 my $final_status = 0; 86 83 87 my $launch_cmd = "";88 if($ENV{'PERLPATH'}) {89 84 # need to ensure that the path to perl is quoted (in case there's spaces in it) 90 if($ENV{'GSDLOS'} =~ m/windows/) { 91 $launch_cmd = "\"$ENV{'PERLPATH'}\\Perl.exe\" -S "; 92 } else { 93 $launch_cmd = "\"$ENV{'PERLPATH'}/perl\" -S "; 94 } 95 } else { 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 "; 98 } 85 my $launch_cmd = "\"".&util::get_perl_exec()."\" -S "; 99 86 100 87 print STDERR "\n"; -
main/trunk/greenstone2/bin/script/mirror.pl
r24192 r24362 48 48 } 49 49 50 use Config; # for getting the perlpath in the recommended way51 50 use arcinfo; 52 51 use colcfg; … … 117 116 # run the mirror program from the import directory 118 117 my $cmd = "cd $importdir; "; 119 # Config{perlpath}, like $^X, is a special variable containing the full path to the current perl executable we are in120 $cmd .= "\" $Config{perlpath}\" -S gsw3mir.pl -cfgfile $etcdir/w3mir.cfg";118 # need to ensure that the path to perl is quoted (in case there's spaces in it) 119 $cmd .= "\"".&util::get_perl_exec()."\" -S gsw3mir.pl -cfgfile $etcdir/w3mir.cfg"; 121 120 # print "\n$cmd\n"; 122 121 `$cmd`; … … 128 127 elsif ((-e "$etcdir/wget.cfg") && (-e "$etcdir/wget.url")) { 129 128 $ENV{WGETRC} = "$etcdir/wget.cfg"; 130 my $cmd = "\" $Config{perlpath}\" -S gsWget.pl --input-file=$etcdir/wget.url --directory-prefix=$importdir";129 my $cmd = "\"".&util::get_perl_exec()."\" -S gsWget.pl --input-file=$etcdir/wget.url --directory-prefix=$importdir"; 131 130 system($cmd); 132 131 }
Note:
See TracChangeset
for help on using the changeset viewer.