Changeset 24463

Show
Ignore:
Timestamp:
24.08.2011 16:17:19 (8 years ago)
Author:
davidb
Message:

More careful/restricted inclusion of builder classes from extension folder

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/buildcol.pl

    r24459 r24463  
    369369 
    370370    # Read in the collection configuration file. 
    371     my ($collectcfg, $buildtype);  
     371    my ($collectcfg, $buildtype, $orthogonalbuildtypes);  
    372372    ($configfilename, $gs_mode) = &colcfg::get_collect_cfg_name($out); 
    373373    $collectcfg = &colcfg::read_collection_cfg ($configfilename, $gs_mode); 
     
    394394    $buildtype = "mg"; #mg is the default 
    395395    } 
     396 
     397    if (defined $collectcfg->{'orthogonalbuildtypes'}) { 
     398    $orthogonalbuildtypes = $collectcfg->{'orthogonalbuildtypes'}; 
     399    } 
     400 
    396401    if (defined $collectcfg->{'archivedir'} && $archivedir eq "") { 
    397402    $archivedir = $collectcfg->{'archivedir'}; 
     
    564569    my @buildertype_list = ($buildertype); 
    565570     
    566     if (defined $ENV{'GSDLEXTS'}) { 
    567      
    568     my $ext_prefix = &util::filename_cat($ENV{'GSDLHOME'}, "ext"); 
    569      
    570     my @extensions = split(/:/,$ENV{'GSDLEXTS'}); 
    571     foreach my $e (@extensions) { 
    572         my $pm = "$e-builder.pm"; 
    573         $pm =~ s/-(.)/\u$1/g; 
    574  
    575         my $extbuilderdir  = &util::filename_cat($ext_prefix,$e,"perllib"); 
    576         my $full_pm = &util::filename_cat($extbuilderdir,$pm); 
    577                              
    578         if (-e $full_pm) { 
    579         my ($extbuildertype) = ($pm =~ m/^(.*)\.pm$/); 
    580         push(@builderdir_list,$extbuilderdir); 
    581         push(@buildertype_list,$extbuildertype); 
    582         } 
    583     } 
    584     } 
    585  
    586     if (defined $ENV{'GSDL3EXTS'}) { 
    587      
    588     my $ext_prefix = &util::filename_cat($ENV{'GSDL3SRCHOME'}, "ext"); 
    589      
    590     my @extensions = split(/:/,$ENV{'GSDL3EXTS'}); 
    591  
    592     foreach my $e (@extensions) { 
    593         my $pm = "$e-builder.pm"; 
    594         $pm =~ s/-(.)/\u$1/g; 
    595  
    596         my $extbuilderdir  = &util::filename_cat($ext_prefix,$e,"perllib"); 
    597         my $full_pm = &util::filename_cat($extbuilderdir,$pm); 
    598                              
    599         if (-e $full_pm) { 
    600         my ($extbuildertype) = ($pm =~ m/^(.*)\.pm$/); 
    601         push(@builderdir_list,$extbuilderdir); 
    602         push(@buildertype_list,$extbuildertype); 
    603         } 
     571    if (defined $orthogonalbuildtypes) { 
     572    foreach my $obt (@$orthogonalbuildtypes) { 
     573 
     574        push(@builderdir_list,undef); # rely on @INC to find it 
     575        push(@buildertype_list,$obt."Builder"); 
    604576    } 
    605577    }