Changeset 14199 for gsdl/trunk
- Timestamp:
- 2007-06-29T12:41:53+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/basebuilder.pm
r14112 r14199 26 26 package basebuilder; 27 27 28 use strict;29 no strict 'refs'; # allow filehandles to be variables and viceversa30 31 28 use classify; 32 29 use cfgread; … … 57 54 $maxdocs, $debug, $keepold, $incremental, $incremental_dlc, 58 55 $remove_empty_classifications, 59 $outhandle, $no_text, $failhandle, $gli ) = @_;60 61 $outhandle = *STDERR unless defined $outhandle;56 $outhandle, $no_text, $failhandle, $gli, $disable_OAI) = @_; 57 58 $outhandle = STDERR unless defined $outhandle; 62 59 $no_text = 0 unless defined $no_text; 63 $failhandle = *STDERR unless defined $failhandle;60 $failhandle = STDERR unless defined $failhandle; 64 61 65 62 # create a builder object … … 78 75 'failhandle'=>$failhandle, 79 76 'notbuilt'=>{}, # indexes not built 80 'gli'=>$gli 77 'gli'=>$gli, 78 'disable_OAI'=>$disable_OAI 81 79 }, $class; 82 80 83 81 $self->{'gli'} = 0 unless defined $self->{'gli'}; 84 85 # Read in the collection configuration file. 86 my ($colcfgname); 87 ($colcfgname, $gs_mode) = &colcfg::get_collect_cfg_name($outhandle); 88 if ($gs_mode eq "gs2") { 89 $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname); 90 } elsif ($gs_mode eq "gs3") { 91 $self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname); 82 $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 } 92 101 } 93 102 … … 187 196 my ($buildprocdir, $buildproctype); 188 197 my $collection = $self->{'collection'}; 189 if (-e "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib/custombuildproc.pm") { 190 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib"; 191 $buildproctype = "custombuildproc"; 192 } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/custombuildproc.pm") { 193 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib"; 194 $buildproctype = "custombuildproc"; 195 } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") { 198 if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") { 196 199 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib"; 197 200 $buildproctype = "${collection}buildproc"; … … 237 240 $self->{'maxnumeric'} = $maxnumeric; 238 241 } 242 # It seems we don't need this sub 243 #sub set_disable_OAI { 244 # my $disable_OAI = shift (@_); 245 # my ($disable_OAI = @_; 246 # 247 # $self->{'disable_OAI'} = $disable_OAI; 248 #} 239 249 sub set_strip_html { 240 250 my $self = shift (@_); … … 269 279 # and their directory names (includes subcolls and langs) 270 280 $self->{'index_mapping'} = $self->create_index_mapping ($indexes); 271 281 282 my $indexmap = $self->{'index_mapping'}->{'indexmap'}; 283 272 284 # build each of the indexes 273 285 foreach my $index (@$indexes) { … … 339 351 my ($handle); 340 352 if ($self->{'debug'}) { 341 $handle = *STDOUT;353 $handle = STDOUT; 342 354 } else { 343 355 if (!-e "$txt2db_exe" || !open (PIPEOUT, "| txt2db$exe \"$fulldbname\"")) { … … 345 357 die "builder::make_infodatabase - couldn't run $txt2db_exe\n"; 346 358 } 347 $handle = *PIPEOUT;359 $handle = basebuilder::PIPEOUT; 348 360 } 349 361 … … 427 439 $build_cfg->{'numsections'} = $self->{'buildproc'}->get_num_sections(); 428 440 $build_cfg->{'numbytes'} = $self->{'buildproc'}->get_num_bytes(); 429 441 442 # store whether to disable OAI service 443 $build_cfg->{'disable_OAI'} = $self->{'disable_OAI'}; 444 430 445 # store the mapping between the index names and the directory names 431 446 # the index map is used to determine what indexes there are, so any that are not built should not be put into the map. … … 463 478 464 479 if ($gs_mode eq "gs2") { 465 &colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg); 480 &colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg'}); 481 ##&colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg); 466 482 } 467 483 if ($gs_mode eq "gs3") { 484 ##&colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg); 468 485 &colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg'}); 469 486 }
Note:
See TracChangeset
for help on using the changeset viewer.