Changeset 1853
- Timestamp:
- 2001-01-22T15:37:46+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r1761 r1853 64 64 &util::filename_cat ($ENV{'GSDLHOME'}, "collect") . ")\n"; 65 65 print STDERR " -out Filename or handle to print output status to.\n"; 66 print STDERR " The default is STDERR\n\n"; 66 print STDERR " The default is STDERR\n"; 67 print STDERR " -buildtype mg|mgpp THis will override the config file setting. (default is mg)\n"; 68 print STDERR " -no_strip_html Do not strip the html tags from the indexed text (only used for mgpp collections).\n\n"; 67 69 } 68 70 … … 72 74 my ($verbosity, $archivedir, $cachedir, $builddir, $maxdocs, 73 75 $debug, $mode, $indexname, $keepold, $allclassifications, 74 $create_images, $collectdir, $out); 76 $create_images, $collectdir, $out, $buildtype, $textindex, 77 $no_strip_html); 75 78 if (!parsargv::parse(\@ARGV, 76 79 'verbosity/\d+/2', \$verbosity, … … 86 89 'create_images', \$create_images, 87 90 'collectdir/.*/', \$collectdir, 88 'out/.*/STDERR', \$out)) { 91 'out/.*/STDERR', \$out, 92 'no_strip_html', \$no_strip_html, 93 'buildtype/^(mg|mgpp)$/', \$buildtype)) { 89 94 &print_usage(); 90 95 die "\n"; 91 96 } 92 97 98 $textindex = ""; 93 99 my $close_out = 0; 94 100 if ($out !~ /^(STDERR|STDOUT)$/i) { … … 106 112 107 113 # read the configuration file 108 $textindex = "section:text"; 114 109 115 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 110 116 if (-e $configfilename) { 111 117 $collectcfg = &colcfg::read_collect_cfg ($configfilename); 118 119 if (defined $collectcfg->{'buildtype'} && $buildtype eq "") { 120 $buildtype = $collectcfg->{'buildtype'}; 121 } 122 if ($buildtype eq "") { 123 $buildtype = "mg"; # mg is the default 124 } 112 125 if (defined $collectcfg->{'archivedir'} && $archivedir eq "") { 113 126 $archivedir = $collectcfg->{'archivedir'}; … … 119 132 $builddir = $collectcfg->{'builddir'}; 120 133 } 134 if ($buildtype eq "mgpp" && defined $collectcfg->{'textcompress'}) { 135 $textindex = $collectcfg->{'textcompress'}; 136 } 137 121 138 } else { 122 139 die "Couldn't find the configuration file $configfilename\n"; 123 140 } 124 141 142 #mgpp doesn't work yet on windows 143 if ($buildtype eq "mgpp" && $ENV{'GSDLOS'} =~ /^windows$/) { 144 die "mgpp doesn't work on windows\n"; 145 } 146 147 #set the text index 148 if ($buildtype eq "mgpp") { 149 if ($textindex eq "") { 150 $textindex = "text"; 151 } 152 } 153 else { 154 $textindex = "section:text"; 155 } 156 125 157 # create default images if required 126 158 if ($create_images) { … … 165 197 166 198 # if a builder class has been created for this collection, use it 167 # otherwise, use the mg builder199 # otherwise, use the mg or mgpp builder 168 200 if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}builder.pm") { 169 201 $builderdir = "$ENV{'GSDLCOLLECTDIR'}/perllib"; … … 171 203 } else { 172 204 $builderdir = "$ENV{'GSDLHOME'}/perllib"; 173 $buildertype = "mgbuilder"; 205 if ($buildtype eq "mgpp") { 206 $buildertype = "mgppbuilder"; 207 } 208 else { 209 $buildertype = "mgbuilder"; 210 } 174 211 } 175 212 … … 183 220 $builder->init(); 184 221 222 if ($buildertype eq "mgppbuilder" && $no_strip_html) { 223 $builder->set_strip_html(0); 224 } 185 225 if ($mode =~ /^all$/i) { 186 226 $builder->compress_text($textindex); … … 261 301 close CFGFILE; 262 302 } 303
Note:
See TracChangeset
for help on using the changeset viewer.