- Timestamp:
- 2007-07-12T11:05:39+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/basebuilder.pm
r14212 r14245 26 26 package basebuilder; 27 27 28 use strict; 29 no strict 'refs'; # allow filehandles to be variables and viceversa 30 28 31 use classify; 29 32 use cfgread; … … 56 59 $outhandle, $no_text, $failhandle, $gli, $disable_OAI) = @_; 57 60 58 $outhandle = STDERR unless defined $outhandle;61 $outhandle = *STDERR unless defined $outhandle; 59 62 $no_text = 0 unless defined $no_text; 60 $failhandle = STDERR unless defined $failhandle;63 $failhandle = *STDERR unless defined $failhandle; 61 64 62 65 # create a builder object … … 80 83 81 84 $self->{'gli'} = 0 unless defined $self->{'gli'}; 85 86 # disable_OIA applies to greenstone 3 only and is only passed to &colcfg::write_build_cfg_xml (then cfgread4gs3::write_cfg_file) when writing the buildConfig.xml 82 87 $self->{'disable_OAI'} = 0 unless defined $self->{'disable_OAI'}; 83 84 # read in the collection configuration file 85 my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collect.cfg"; 86 if (-e $colcfgname) { 87 ##$self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname); 88 $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname); 89 $gs_mode = "gs2"; 90 } 91 else { 92 my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collectionConfig.xml"; 93 if (!-e $colcfgname) { 94 die "mgbuilder::new - couldn't find collectionConfig.xml for collection $collection\n"; 95 } 96 else { 97 #$self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname); 98 $self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname); 99 $gs_mode = "gs3"; 100 } 88 89 # Read in the collection configuration file. 90 my ($colcfgname); 91 ($colcfgname, $gs_mode) = &colcfg::get_collect_cfg_name($outhandle); 92 if ($gs_mode eq "gs2") { 93 $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname); 94 } elsif ($gs_mode eq "gs3") { 95 $self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname); 101 96 } 102 97 … … 196 191 my ($buildprocdir, $buildproctype); 197 192 my $collection = $self->{'collection'}; 198 if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") { 193 if (-e "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib/custombuildproc.pm") { 194 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib"; 195 $buildproctype = "custombuildproc"; 196 } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/custombuildproc.pm") { 197 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib"; 198 $buildproctype = "custombuildproc"; 199 } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") { 199 200 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib"; 200 201 $buildproctype = "${collection}buildproc"; … … 240 241 $self->{'maxnumeric'} = $maxnumeric; 241 242 } 242 # It seems we don't need this sub243 #sub set_disable_OAI {244 # my $disable_OAI = shift (@_);245 # my ($disable_OAI = @_;246 #247 # $self->{'disable_OAI'} = $disable_OAI;248 #}249 243 sub set_strip_html { 250 244 my $self = shift (@_); … … 279 273 # and their directory names (includes subcolls and langs) 280 274 $self->{'index_mapping'} = $self->create_index_mapping ($indexes); 281 282 my $indexmap = $self->{'index_mapping'}->{'indexmap'}; 283 275 284 276 # build each of the indexes 285 277 foreach my $index (@$indexes) { … … 351 343 my ($handle); 352 344 if ($self->{'debug'}) { 353 $handle = STDOUT;345 $handle = *STDOUT; 354 346 } else { 355 347 if (!-e "$txt2db_exe" || !open (PIPEOUT, "| txt2db$exe \"$fulldbname\"")) { … … 357 349 die "builder::make_infodatabase - couldn't run $txt2db_exe\n"; 358 350 } 359 $handle = basebuilder::PIPEOUT;351 $handle = *PIPEOUT; 360 352 } 361 353 … … 439 431 $build_cfg->{'numsections'} = $self->{'buildproc'}->get_num_sections(); 440 432 $build_cfg->{'numbytes'} = $self->{'buildproc'}->get_num_bytes(); 441 442 # store whether to disable OAI service 443 $build_cfg->{'disable_OAI'} = $self->{'disable_OAI'}; 444 433 445 434 # store the mapping between the index names and the directory names 446 435 # the index map is used to determine what indexes there are, so any that are not built should not be put into the map. … … 478 467 479 468 if ($gs_mode eq "gs2") { 480 #&colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg'});481 469 &colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg); 482 470 } 483 471 if ($gs_mode eq "gs3") { 484 #&colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg); 485 &colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg'}); 472 &colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg'}, $self->{'disable_OAI'}); 486 473 } 487 474
Note:
See TracChangeset
for help on using the changeset viewer.