Changeset 14112 for trunk/gsdl/perllib/basebuilder.pm
- Timestamp:
- 2007-05-30T17:55:36+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/basebuilder.pm
r14022 r14112 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) = @_; 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 $self->{'gli'} = 0 unless defined $self->{'gli'}; 81 84 82 # read in the collection configuration file 83 my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collect.cfg"; 84 if (-e $colcfgname) { 85 $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname); 86 $gs_mode = "gs2"; 87 } 88 else { 89 my $colcfgname = "$ENV{'GSDLCOLLECTDIR'}/etc/collectionConfig.xml"; 90 if (!-e $colcfgname) { 91 die "mgbuilder::new - couldn't find collect.cfg for collection $collection\n"; 92 } 93 else { 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") { 94 91 $self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname); 95 $gs_mode = "gs3";96 }97 92 } 98 93 … … 192 187 my ($buildprocdir, $buildproctype); 193 188 my $collection = $self->{'collection'}; 194 if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") { 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") { 195 196 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib"; 196 197 $buildproctype = "${collection}buildproc"; … … 338 339 my ($handle); 339 340 if ($self->{'debug'}) { 340 $handle = STDOUT;341 $handle = *STDOUT; 341 342 } else { 342 343 if (!-e "$txt2db_exe" || !open (PIPEOUT, "| txt2db$exe \"$fulldbname\"")) { … … 344 345 die "builder::make_infodatabase - couldn't run $txt2db_exe\n"; 345 346 } 346 $handle = basebuilder::PIPEOUT;347 $handle = *PIPEOUT; 347 348 } 348 349
Note:
See TracChangeset
for help on using the changeset viewer.