Changeset 10457


Ignore:
Timestamp:
2005-08-10T13:32:41+12:00 (19 years ago)
Author:
kjdon
Message:

changed
if (-e $configfilename) {
...
} else {

die;

}
to
if (!-e $configfilename) {
die;
}
and so retabbed the code from the old if bit

File:
1 edited

Legend:

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

    r10417 r10457  
    197197    $debug, $mode, $indexname, $removeold, $keepold, $remove_empty_classifications,
    198198    $create_images, $collectdir, $build, $type, $textindex,
    199     $no_strip_html, $no_text, $faillog, $gli, $index, $language);
     199    $no_strip_html, $no_text, $faillog, $gli, $index, $language,
     200    $sections_index_document_metadata);
    200201
    201202    my $xml = 0;
     
    271272    my ($collectcfg, $buildtype);
    272273
    273     if (-e $configfilename) {
    274     $collectcfg = &colcfg::read_collect_cfg ($configfilename);
    275 
    276     if ($verbosity !~ /\d+/) {
    277         if (defined $collectcfg->{'verbosity'} && $collectcfg->{'verbosity'} =~ /\d+/) {
    278         $verbosity = $collectcfg->{'verbosity'};
    279         } else {
    280         $verbosity = 2; # the default
    281         }
    282     }
    283     # we use searchtype for determining buildtype, but for old versions, use buildtype
    284     if (defined $collectcfg->{'buildtype'}) {
    285         $buildtype = $collectcfg->{'buildtype'};
    286     } elsif (defined $collectcfg->{'searchtypes'} || defined $collectcfg->{'searchtype'}) {
    287         $buildtype = "mgpp";
     274    if (!-e $configfilename) {
     275    &gsprintf($out, "{common.cannot_find_cfg_file}\n", $configfilename) && die;
     276    }
     277   
     278    $collectcfg = &colcfg::read_collect_cfg ($configfilename);
     279   
     280    if ($verbosity !~ /\d+/) {
     281    if (defined $collectcfg->{'verbosity'} && $collectcfg->{'verbosity'} =~ /\d+/) {
     282        $verbosity = $collectcfg->{'verbosity'};
    288283    } else {
    289         $buildtype = "mg"; #mg is the default
    290     }
    291     if (defined $collectcfg->{'archivedir'} && $archivedir eq "") {
    292         $archivedir = $collectcfg->{'archivedir'};
    293     }
    294     if (defined $collectcfg->{'cachedir'} && $cachedir eq "") {
    295         $cachedir = $collectcfg->{'cachedir'};
    296     }
    297     if (defined $collectcfg->{'builddir'} && $builddir eq "") {
    298         $builddir = $collectcfg->{'builddir'};
    299     }
    300     if ($maxdocs !~ /\-?\d+/) {
    301         if (defined $collectcfg->{'maxdocs'} && $collectcfg->{'maxdocs'} =~ /\-?\d+/) {
    302         $maxdocs = $collectcfg->{'maxdocs'};
    303         } else {
    304         $maxdocs = -1; # the default
    305         }
    306     }
    307     if (defined $collectcfg->{'debug'} && $collectcfg->{'debug'} =~ /^true$/i) {
    308         $debug = 1;
    309     }
    310     if ($mode !~ /^(all|compress_text|build_index|infodb)$/) {
    311         if (defined $collectcfg->{'mode'} && $collectcfg->{'mode'} =~ /^(all|compress_text|build_index|infodb)$/) {
    312         $mode = $collectcfg->{'mode'};
    313         } else {
    314         $mode = "all"; # the default
    315         }
    316     }
    317     if (defined $collectcfg->{'index'} && $indexname eq "") {
    318         $indexname = $collectcfg->{'index'};
    319     }
    320     if (defined $collectcfg->{'no_text'} && $no_text == 0) {
    321         if ($collectcfg->{'no_text'} =~ /^true$/i) {
    322         $no_text = 1;
    323         }
    324     }
    325     if (defined $collectcfg->{'no_strip_html'} && $no_strip_html == 0) {
    326         if ($collectcfg->{'no_strip_html'} =~ /^true$/i) {
    327         $no_strip_html = 1;
    328         }
    329     }
    330     if (defined $collectcfg->{'remove_empty_classifications'} && $remove_empty_classifications == 0) {
    331         if ($collectcfg->{'remove_empty_classifications'} =~ /^true$/i) {
    332         $remove_empty_classifications = 1;
    333         }
    334     }
    335 
    336     if (defined $collectcfg->{'create_images'} && $collectcfg->{'create_images'} =~ /^true$/i) {
    337         $create_images = 1;
    338     }
    339     if ($buildtype eq "mgpp" && defined $collectcfg->{'textcompress'}) {
    340         $textindex = $collectcfg->{'textcompress'};
    341     }
    342     if (defined $collectcfg->{'gli'} && $collectcfg->{'gli'} =~ /^true$/i) {
    343         $gli = 1;
    344     }
    345    
     284        $verbosity = 2; # the default
     285    }
     286    }
     287    # we use searchtype for determining buildtype, but for old versions, use buildtype
     288    if (defined $collectcfg->{'buildtype'}) {
     289    $buildtype = $collectcfg->{'buildtype'};
     290    } elsif (defined $collectcfg->{'searchtypes'} || defined $collectcfg->{'searchtype'}) {
     291    $buildtype = "mgpp";
    346292    } else {
    347     &gsprintf($out, "{common.cannot_find_cfg_file}\n", $configfilename) && die;
    348     }
    349 
     293    $buildtype = "mg"; #mg is the default
     294    }
     295    if (defined $collectcfg->{'archivedir'} && $archivedir eq "") {
     296    $archivedir = $collectcfg->{'archivedir'};
     297    }
     298    if (defined $collectcfg->{'cachedir'} && $cachedir eq "") {
     299    $cachedir = $collectcfg->{'cachedir'};
     300    }
     301    if (defined $collectcfg->{'builddir'} && $builddir eq "") {
     302    $builddir = $collectcfg->{'builddir'};
     303    }
     304    if ($maxdocs !~ /\-?\d+/) {
     305    if (defined $collectcfg->{'maxdocs'} && $collectcfg->{'maxdocs'} =~ /\-?\d+/) {
     306        $maxdocs = $collectcfg->{'maxdocs'};
     307    } else {
     308        $maxdocs = -1; # the default
     309    }
     310    }
     311    if (defined $collectcfg->{'debug'} && $collectcfg->{'debug'} =~ /^true$/i) {
     312    $debug = 1;
     313    }
     314    if ($mode !~ /^(all|compress_text|build_index|infodb)$/) {
     315    if (defined $collectcfg->{'mode'} && $collectcfg->{'mode'} =~ /^(all|compress_text|build_index|infodb)$/) {
     316        $mode = $collectcfg->{'mode'};
     317    } else {
     318        $mode = "all"; # the default
     319    }
     320    }
     321    if (defined $collectcfg->{'index'} && $indexname eq "") {
     322    $indexname = $collectcfg->{'index'};
     323    }
     324    if (defined $collectcfg->{'no_text'} && $no_text == 0) {
     325    if ($collectcfg->{'no_text'} =~ /^true$/i) {
     326        $no_text = 1;
     327    }
     328    }
     329    if (defined $collectcfg->{'no_strip_html'} && $no_strip_html == 0) {
     330    if ($collectcfg->{'no_strip_html'} =~ /^true$/i) {
     331        $no_strip_html = 1;
     332    }
     333    }
     334    if (defined $collectcfg->{'remove_empty_classifications'} && $remove_empty_classifications == 0) {
     335    if ($collectcfg->{'remove_empty_classifications'} =~ /^true$/i) {
     336        $remove_empty_classifications = 1;
     337    }
     338    }
     339   
     340    if (defined $collectcfg->{'create_images'} && $collectcfg->{'create_images'} =~ /^true$/i) {
     341    $create_images = 1;
     342    }
     343    if ($buildtype eq "mgpp" && defined $collectcfg->{'textcompress'}) {
     344    $textindex = $collectcfg->{'textcompress'};
     345    }
     346    if (defined $collectcfg->{'gli'} && $collectcfg->{'gli'} =~ /^true$/i) {
     347    $gli = 1;
     348    }
     349   
    350350    ($removeold, $keepold) = &scriptutil::check_removeold_and_keepold($removeold, $keepold, "building", $collectcfg);
    351351 
Note: See TracChangeset for help on using the changeset viewer.