Changeset 10256


Ignore:
Timestamp:
2005-07-19T16:57:23+12:00 (19 years ago)
Author:
kjdon
Message:

added use strict, and fixed up compile erros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/buildcol.pl

    r10215 r10256  
    4040
    4141use colcfg;
    42 use parsargv;
    4342use util;
    4443use FileHandle;
     
    4645use printusage;
    4746use parse2;
     47
     48use strict;
     49no strict 'refs'; # allow filehandles to be variables and vice versa
     50no strict 'subs'; # allow barewords (eg STDERR) as function arguments
    4851
    4952my $mode_list =
     
    167170        'args' => $arguments };
    168171
     172
     173# globals
     174my $collection;
     175my $configfilename;
     176my $out;
     177
    169178sub gsprintf
    170179{
     
    173182
    174183
     184
    175185&main();
    176 
    177186
    178187sub main
    179188{
     189    # command line args
    180190    my ($verbosity, $archivedir, $cachedir, $builddir, $maxdocs,
    181191    $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);
    184194
    185195    my $xml = 0;
     
    188198    my $blnParseFailed = "false";
    189199    # 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");
    191201    # If there are more than one argument left after parsing, it mean user input too many arguments.
    192202    # Error occoured  will return 0
     
    208218    # If $language has been specified, load the appropriate resource bundle
    209219    # (Otherwise, the default resource bundle will be loaded automatically)
    210     if ($language) {
     220    if ($language && $language =~ /\S/) {
    211221    &gsprintf::load_language_specific_resource_bundle($language);
    212222    }
     
    253263    # read the configuration file
    254264    $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg");
     265    my ($collectcfg, $buildtype);
     266
    255267    if (-e $configfilename) {
    256268    $collectcfg = &colcfg::read_collect_cfg ($configfilename);
     
    266278    if (defined $collectcfg->{'buildtype'}) {
    267279        $buildtype = $collectcfg->{'buildtype'};
    268     } elsif (defined $collectcfg->{'searchtype'}) {
     280    } elsif (defined $collectcfg->{'searchtypes'} || defined $collectcfg->{'searchtype'}) {
    269281        $buildtype = "mgpp";
    270282    } else {
     
    356368    # fill in the default archives and building directories if none
    357369    # were supplied, turn all \ into / and remove trailing /
     370
     371    my ($realarchivedir, $realbuilddir); 
    358372    $archivedir = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "archives") if $archivedir eq "";
    359373    $archivedir =~ s/[\\\/]+/\//g;
     
    386400    &util::mk_all_dir ($realbuilddir);
    387401
    388 
     402    my ($buildertype, $builderdir,  $builder);
    389403    # if a builder class has been created for this collection, use it
    390404    # otherwise, use the mg or mgpp builder
Note: See TracChangeset for help on using the changeset viewer.