Changeset 2355
- Timestamp:
- 2001-05-03T13:59:37+12:00 (23 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r2336 r2355 85 85 $create_images, $collectdir, $out, $buildtype, $textindex, 86 86 $no_strip_html, $no_text); 87 88 # note that no defaults are passed for most options as they're set 89 # later (after we check the collect.cfg file) 87 90 if (!parsargv::parse(\@ARGV, 88 'verbosity/\d+/ 2', \$verbosity,91 'verbosity/\d+/', \$verbosity, 89 92 'archivedir/.*/', \$archivedir, 90 93 'cachedir/.*/', \$cachedir, 91 94 'builddir/.*/', \$builddir, 92 'maxdocs/^\-?\d+/ -1', \$maxdocs,95 'maxdocs/^\-?\d+/', \$maxdocs, 93 96 'debug', \$debug, 94 'mode/^(all|compress_text|build_index|infodb)$/ all', \$mode,97 'mode/^(all|compress_text|build_index|infodb)$/', \$mode, 95 98 'index/.*/', \$indexname, 96 99 'no_text', \$no_text, … … 122 125 123 126 # read the configuration file 124 125 127 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); 126 128 if (-e $configfilename) { 127 129 $collectcfg = &colcfg::read_collect_cfg ($configfilename); 128 130 131 if ($verbosity !~ /\d+/) { 132 if (defined $collectcfg->{'verbosity'} && $collectcfg->{'verbosity'} =~ /\d+/) { 133 $verbosity = $collectcfg->{'verbosity'}; 134 } else { 135 $verbosity = 2; # the default 136 } 137 } 129 138 if (defined $collectcfg->{'buildtype'} && $buildtype eq "") { 130 139 $buildtype = $collectcfg->{'buildtype'}; … … 142 151 $builddir = $collectcfg->{'builddir'}; 143 152 } 144 if (defined $collectcfg->{'collectdir'} && $collectdir eq "") { 145 $collectdir = $collectcfg->{'collectdir'}; 153 if ($maxdocs !~ /\-?\d+/) { 154 if (defined $collectcfg->{'maxdocs'} && $collectcfg->{'maxdocs'} =~ /\-?\d+/) { 155 $maxdocs = $collectcfg->{'maxdocs'}; 156 } else { 157 $maxdocs = -1; # the default 158 } 159 } 160 if (defined $collectcfg->{'debug'} && $collectcfg->{'debug'} =~ /^true$/i) { 161 $debug = 1; 162 } 163 if ($mode !~ /^(all|compress_text|build_index|infodb)$/) { 164 if (defined $collectcfg->{'mode'} && $collectcfg->{'mode'} =~ /^(all|compress_text|build_index|infodb)$/) { 165 $mode = $collectcfg->{'mode'}; 166 } else { 167 $mode = "all"; # the default 168 } 169 } 170 if (defined $collectcfg->{'index'} && $indexname eq "") { 171 $indexname = $collectcfg->{'index'}; 146 172 } 147 173 if (defined $collectcfg->{'no_text'} && $no_text == 0) { 148 if ($collectcfg->{'no_text'} =~ /^true$/ ) {174 if ($collectcfg->{'no_text'} =~ /^true$/i) { 149 175 $no_text = 1; 150 176 } 151 177 } 152 178 if (defined $collectcfg->{'allclassifications'} && $allclassifications == 0) { 153 if ($collectcfg->{'allclassifications'} =~ /^true$/ ) {179 if ($collectcfg->{'allclassifications'} =~ /^true$/i) { 154 180 $allclassifications = 1; 155 181 } 182 } 183 if (defined $collectcfg->{'keepold'} && $collectcfg->{'keepold'} =~ /^true$/i) { 184 $keepold = 1; 185 } 186 if (defined $collectcfg->{'create_images'} && $collectcfg->{'create_images'} =~ /^true$/i) { 187 $create_images = 1; 156 188 } 157 189 if ($buildtype eq "mgpp" && defined $collectcfg->{'textcompress'}) { -
trunk/gsdl/bin/script/import.pl
r2328 r2355 92 92 $pluginfo, $sortmeta, $archive_info_filename, 93 93 $archive_info, $processor, $out, $collectdir); 94 if (!parsargv::parse(\@ARGV, 95 'verbosity/\d+/2', \$verbosity, 94 95 # note that no defaults are passed for most options as they're set 96 # later (after we check the collect.cfg file) 97 if (!parsargv::parse(\@ARGV, 98 'verbosity/\d+/', \$verbosity, 96 99 'importdir/.*/', \$importdir, 97 'archivedir/.*/', \$archivedir, 98 'keepold', \$keepold, 99 'removeold', \$removeold, 100 'gzip', \$gzip, 101 'groupsize/\d+/ 1', \$groupsize,102 'OIDtype/^(hash|incremental)$/ hash', \$OIDtype,103 'sortmeta/.*/', \$sortmeta, 100 'archivedir/.*/', \$archivedir, 101 'keepold', \$keepold, 102 'removeold', \$removeold, 103 'gzip', \$gzip, 104 'groupsize/\d+/', \$groupsize, 105 'OIDtype/^(hash|incremental)$/', \$OIDtype, 106 'sortmeta/.*/', \$sortmeta, 104 107 'debug', \$debug, 105 'maxdocs/^\-?\d+/ -1', \$maxdocs,108 'maxdocs/^\-?\d+/', \$maxdocs, 106 109 'collectdir/.*/', \$collectdir, 107 110 'out/.*/STDERR', \$out)) { … … 142 145 143 146 144 # get the list of plugins for this collection 147 # get the list of plugins for this collection and set any options that 148 # were specified in the collect.cfg (all import.pl options except 149 # -collectdir and -out may be specified in the collect.cfg (these 150 # options must be known before we read the collect.cfg)) 145 151 my $plugins = []; 146 152 $configfilename = &util::filename_cat ($ENV{'GSDLCOLLECTDIR'}, "etc", "collect.cfg"); … … 150 156 $plugins = $collectcfg->{'plugin'}; 151 157 } 158 159 if ($verbosity !~ /\d+/) { 160 if (defined $collectcfg->{'verbosity'} && $collectcfg->{'verbosity'} =~ /\d+/) { 161 $verbosity = $collectcfg->{'verbosity'}; 162 } else { 163 $verbosity = 2; # the default 164 } 165 } 152 166 if (defined $collectcfg->{'importdir'} && $importdir eq "") { 153 167 $importdir = $collectcfg->{'importdir'}; … … 164 178 } 165 179 } 180 if (defined $collectcfg->{'keepold'}) { 181 if ($collectcfg->{'keepold'} =~ /^false$/i && !$keepold) { 182 $removeold = 1; 183 } 184 } 185 if (defined $collectcfg->{'gzip'} && !$gzip) { 186 if ($collectcfg->{'gzip'} =~ /^true$/i) { 187 $gzip = 1; 188 } 189 } 190 if ($maxdocs !~ /\-?\d+/) { 191 if (defined $collectcfg->{'maxdocs'} && $collectcfg->{'maxdocs'} =~ /\-?\d+/) { 192 $maxdocs = $collectcfg->{'maxdocs'}; 193 } else { 194 $maxdocs = -1; # the default 195 } 196 } 197 if ($groupsize !~ /\d+/) { 198 if (defined $collectcfg->{'groupsize'} && $collectcfg->{'groupsize'} =~ /\d+/ && $groupsize !~ /\d+/) { 199 $groupsize = $collectcfg->{'groupsize'}; 200 } else { 201 $groupsize = 1; # the default 202 } 203 } 204 if ($OIDtype !~ /^(hash|incremental)$/) { 205 if (defined $collectcfg->{'OIDtype'} && $collectcfg->{'OIDtype'} =~ /^(hash|incremental)$/) { 206 $OIDtype = $collectcfg->{'OIDtype'}; 207 } else { 208 $OIDtype = "hash"; # the default 209 } 210 } 211 if (defined $collectcfg->{'sortmeta'} && $sortmeta eq "") { 212 $sortmeta = $collectcfg->{'sortmeta'}; 213 } 214 if (defined $collectcfg->{'debug'} && $collectcfg->{'debug'} =~ /^true$/i) { 215 $debug = 1; 216 } 217 166 218 } else { 167 219 die "Couldn't find the configuration file $configfilename\n"; -
trunk/gsdl/perllib/colcfg.pm
r2336 r2355 67 67 q/^(creator|public|beta|defaultindex|importdir|/ . 68 68 q/archivedir|cachedir|builddir|removeold|/ . 69 q/textcompress|buildtype|collectdir|no_text|allclassifications)$/, 69 q/textcompress|buildtype|no_text|keepold|gzip/ . 70 q/verbosity|allclassifications|OIDtype|maxdocs|/ . 71 q/groupsize|sortmeta|debug|mode|create_images)$/, 70 72 q/(maintainer|languages|indexsubcollections|/ . 71 73 q/indexes|dontbuild|dontgdbm|mirror|phind|levels)$/,
Note:
See TracChangeset
for help on using the changeset viewer.