Changeset 27303 for main/trunk/greenstone2/perllib/IncrementalBuildUtils.pm
- Timestamp:
- 2013-05-06T15:23:45+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/IncrementalBuildUtils.pm
r21646 r27303 42 42 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'}; 43 43 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'}; 44 unshift (@INC, "$ENV{'GSDLHOME'}/perllib"); 45 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan"); 46 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugins"); 47 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/classify"); 44 45 # - ensure we only add perllib paths to INC if they weren't already there 46 # as otherwise we lose the ability to use order in INC as a guide for 47 # inheritence/overriding [jmt12] 48 my $gsdl_perllib_path = $ENV{'GSDLHOME'} . '/perllib'; 49 my $found_path = 0; 50 foreach my $inc_path (@INC) 51 { 52 if ($inc_path eq $gsdl_perllib_path) 53 { 54 $found_path = 1; 55 last; 56 } 57 } 58 if (!$found_path) 59 { 60 unshift (@INC, $gsdl_perllib_path); 61 unshift (@INC, $gsdl_perllib_path . '/cpan'); 62 unshift (@INC, $gsdl_perllib_path . '/plugins'); 63 unshift (@INC, $gsdl_perllib_path . '/classify'); 64 } 48 65 } 49 66 … … 65 82 $path_separator = ";"; 66 83 } 67 $ENV{'PATH'} = &util::filename_cat($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}) . $path_separator . &util::filename_cat($ENV{'GSDLHOME'}, "bin", "script") . $path_separator.$ENV{'PATH'}; 84 # - once again we need to ensure we aren't duplicating paths on the environment 85 # otherwise things like extension executables won't be correctly used in 86 # preference to main Greenstone ones [jmt12] 87 my @env_path = split($path_separator, $ENV{'PATH'}); 88 my $os_binary_path = &util::filename_cat($ENV{'GSDLHOME'}, 'bin', $ENV{'GSDLOS'}); 89 my $script_path = &util::filename_cat($ENV{'GSDLHOME'}, 'bin', 'script'); 90 my $found_os_bin = 0; 91 foreach my $path (@env_path) 92 { 93 if ($path eq $os_binary_path) 94 { 95 $found_os_bin = 1; 96 last; 97 } 98 } 99 if (!$found_os_bin) 100 { 101 $ENV{'PATH'} = $os_binary_path . $path_separator . $script_path . $path_separator . $ENV{'PATH'}; 102 } 103 68 104 69 105 # /**
Note:
See TracChangeset
for help on using the changeset viewer.