Changeset 30306 for gs2-extensions

Show
Ignore:
Timestamp:
12.10.2015 11:24:21 (4 years ago)
Author:
jmt12
Message:

Making the setup of CPAN path more robust based on the better control I now have over where CPAN packages are installed (in the OS-specific install directory)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/bin/script/GDBMServer.pl

    r24847 r30306  
    1919  unshift (@INC, "$ENV{'GSDLHOME'}/perllib/classify"); 
    2020 
     21  my $ext_prefix; 
     22  my @extensions; 
    2123  if (defined $ENV{'GSDLEXTS'}) 
    2224  { 
    23     my @extensions = split(/:/,$ENV{'GSDLEXTS'}); 
    24     foreach my $e (@extensions) 
    25     { 
    26       my $ext_prefix = "$ENV{'GSDLHOME'}/ext/$e"; 
    27       unshift (@INC, "$ext_prefix/perllib"); 
    28       unshift (@INC, "$ext_prefix/perllib/cpan"); 
    29       unshift (@INC, "$ext_prefix/perllib/plugins"); 
    30       unshift (@INC, "$ext_prefix/perllib/classify"); 
    31     } 
    32   } 
    33   if (defined $ENV{'GSDL3EXTS'}) 
    34   { 
    35     my @extensions = split(/:/,$ENV{'GSDL3EXTS'}); 
    36     foreach my $e (@extensions) 
    37     { 
    38       my $ext_prefix = "$ENV{'GSDL3SRCHOME'}/ext/$e"; 
    39       unshift (@INC, "$ext_prefix/perllib"); 
    40       unshift (@INC, "$ext_prefix/perllib/cpan"); 
    41       unshift (@INC, "$ext_prefix/perllib/plugins"); 
    42       unshift (@INC, "$ext_prefix/perllib/classify"); 
    43     } 
    44   } 
    45  
    46   # Manually installed CPAN package in GEXT*INSTALL 
    47   unshift (@INC, $ENV{'GEXTPARALLELBUILDING_INSTALLED'} . "/share/perl5"); 
     25      $ext_prefix = $ENV{'GSDLHOME'}; 
     26      @extensions = split(/:/, $ENV{'GSDLEXTS'}); 
     27  } 
     28  elsif (defined $ENV{'GSDL3EXTS'}) 
     29  { 
     30      $ext_prefix = $ENV{'GSDL3SRCHOME'}; 
     31      @extensions = split(/:/, $ENV{'GSDL3EXTS'}); 
     32  } 
     33  foreach my $e (@extensions) 
     34  { 
     35      my $perllib_path = $ext_prefix . '/ext/' . $e . '/perllib'; 
     36      unshift (@INC, $perllib_path); 
     37      unshift (@INC, $perllib_path . '/cpan'); 
     38      unshift (@INC, $perllib_path . '/plugins'); 
     39      unshift (@INC, $perllib_path . '/plugouts'); 
     40      unshift (@INC, $perllib_path . '/classify'); 
     41  } 
     42 
     43  # Installed CPAN packages for GEXT*INSTALL 
     44  my $perl_version = `perl-version.pl`; 
     45  my $perl_path = sprintf("%s/lib/perl/%s", $ENV{'GEXTPARALLELBUILDING_INSTALLED'}, $perl_version); 
     46  ###rint STDERR "[DEBUG] CPAN Path: $perl_path\n"; 
     47  unshift (@INC, $perl_path); 
    4848} 
    4949