Changeset 10256
- Timestamp:
- 2005-07-19T16:57:23+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r10215 r10256 40 40 41 41 use colcfg; 42 use parsargv;43 42 use util; 44 43 use FileHandle; … … 46 45 use printusage; 47 46 use parse2; 47 48 use strict; 49 no strict 'refs'; # allow filehandles to be variables and vice versa 50 no strict 'subs'; # allow barewords (eg STDERR) as function arguments 48 51 49 52 my $mode_list = … … 167 170 'args' => $arguments }; 168 171 172 173 # globals 174 my $collection; 175 my $configfilename; 176 my $out; 177 169 178 sub gsprintf 170 179 { … … 173 182 174 183 184 175 185 &main(); 176 177 186 178 187 sub main 179 188 { 189 # command line args 180 190 my ($verbosity, $archivedir, $cachedir, $builddir, $maxdocs, 181 191 $debug, $mode, $indexname, $keepold, $remove_empty_classifications, 182 $create_images, $collectdir, $ out, $buildtype, $textindex,183 $no_strip_html, $no_text, $faillog, $gli );192 $create_images, $collectdir, $build, $type, $textindex, 193 $no_strip_html, $no_text, $faillog, $gli, $index, $language); 184 194 185 195 my $xml = 0; … … 188 198 my $blnParseFailed = "false"; 189 199 # general options available to all plugins 190 $intArgLeftinAfterParsing = parse2::parse(\@ARGV,$arguments,$hashParsingResult,"allow_extra_options");200 my $intArgLeftinAfterParsing = parse2::parse(\@ARGV,$arguments,$hashParsingResult,"allow_extra_options"); 191 201 # If there are more than one argument left after parsing, it mean user input too many arguments. 192 202 # Error occoured will return 0 … … 208 218 # If $language has been specified, load the appropriate resource bundle 209 219 # (Otherwise, the default resource bundle will be loaded automatically) 210 if ($language ) {220 if ($language && $language =~ /\S/) { 211 221 &gsprintf::load_language_specific_resource_bundle($language); 212 222 } … … 253 263 # read the configuration file 254 264 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 265 my ($collectcfg, $buildtype); 266 255 267 if (-e $configfilename) { 256 268 $collectcfg = &colcfg::read_collect_cfg ($configfilename); … … 266 278 if (defined $collectcfg->{'buildtype'}) { 267 279 $buildtype = $collectcfg->{'buildtype'}; 268 } elsif (defined $collectcfg->{'searchtype '}) {280 } elsif (defined $collectcfg->{'searchtypes'} || defined $collectcfg->{'searchtype'}) { 269 281 $buildtype = "mgpp"; 270 282 } else { … … 356 368 # fill in the default archives and building directories if none 357 369 # were supplied, turn all \ into / and remove trailing / 370 371 my ($realarchivedir, $realbuilddir); 358 372 $archivedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "archives") if $archivedir eq ""; 359 373 $archivedir =~ s/[\\\/]+/\//g; … … 386 400 &util::mk_all_dir ($realbuilddir); 387 401 388 402 my ($buildertype, $builderdir, $builder); 389 403 # if a builder class has been created for this collection, use it 390 404 # otherwise, use the mg or mgpp builder
Note:
See TracChangeset
for help on using the changeset viewer.