Changeset 783
- Timestamp:
- 1999-11-15T17:52:11+13:00 (24 years ago)
- Location:
- trunk/gsdl/bin/script
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/buildcol.pl
r632 r783 47 47 print STDERR " -builddir directory Where to put the built indexes\n"; 48 48 print STDERR " -maxdocs number Maximum number of documents to build\n"; 49 print STDERR " -debug print output to STDOUT\n"; 50 print STDERR " -mode all|compress_text|build_index|infodb\n"; 51 print STDERR " -index indexname index to build (will build all in config file if not set)\n"; 49 52 print STDERR " -allclassifications Don't remove empty classifications\n\n"; 50 53 } … … 53 56 sub main 54 57 { 58 my ($verbosity, $archivedir, $cachedir, $builddir, $maxdocs, 59 $debug, $mode, $indexname, $allclassifications); 55 60 if (!parsargv::parse(\@ARGV, 56 61 'verbosity/\d+/2', \$verbosity, … … 59 64 'builddir/.*/', \$builddir, 60 65 'maxdocs/\d+/', \$maxdocs, 66 'debug', \$debug, 67 'mode/^(all|compress_text|build_index|infodb)$/all', \$mode, 68 'index/.*/', \$indexname, 61 69 'allclassifications', \$allclassifications)) { 62 70 &print_usage(); … … 69 77 die "\n"; 70 78 } 71 72 # only here to prevent a perl warning73 $maxdocs = "" if $maxdocs !~ /\d/;74 $allclassifications = 0 unless $allclassifications == 1;75 79 76 80 # read the configuration file … … 141 145 eval("\$builder = new $buildertype(\$collection, " . 142 146 "\$realarchivedir, \$realbuilddir, \$verbosity, " . 143 "\$maxdocs, \$ allclassifications)");147 "\$maxdocs, \$debug, \$allclassifications)"); 144 148 die "$@" if $@; 145 149 146 150 $builder->init(); 147 $builder->compress_text($textindex); 148 $builder->build_indexes(); 149 $builder->make_infodatabase(); 150 $builder->collect_specific(); 151 $builder->make_auxiliary_files(); 151 152 if ($mode =~ /^all$/i) { 153 $builder->compress_text($textindex); 154 $builder->build_indexes($indexname); 155 $builder->make_infodatabase(); 156 $builder->collect_specific(); 157 } elsif ($mode =~ /^compress_text$/i) { 158 $builder->compress_text($textindex); 159 } elsif ($mode =~ /^build_index$/i) { 160 $builder->build_indexes($indexname); 161 } elsif ($mode =~ /^infodb$/i) { 162 $builder->make_infodatabase(); 163 } else { 164 die "unknown mode: $mode\n"; 165 } 166 167 $builder->make_auxiliary_files() if !$debug; 152 168 $builder->deinit(); 153 154 155 if ($realbuilddir ne $builddir) { 169 170 if (($realbuilddir ne $builddir) && !$debug) { 156 171 print STDERR "Copying back the cached build\n" if ($verbosity >= 1); 157 172 &util::rm_r ($builddir); -
trunk/gsdl/bin/script/import.pl
r538 r783 40 40 use plugin; 41 41 use docsave; 42 use docprint; 42 43 use util; 43 44 use parsargv; … … 54 55 print STDERR " directory -- use with care\n"; 55 56 print STDERR " -gzip Use gzip to compress resulting gml documents\n"; 57 print STDERR " -debug Print imported text to STDOUT\n"; 56 58 print STDERR " -maxdocs number Maximum number of documents to import\n\n"; 57 59 } … … 61 63 62 64 sub main { 65 my ($verbosity, $importdir, $archivedir, $keepold, 66 $removeold, $gzip, $debug, $maxdocs); 63 67 if (!parsargv::parse(\@ARGV, 64 68 'verbosity/\d+/2', \$verbosity, … … 68 72 'removeold', \$removeold, 69 73 'gzip', \$gzip, 74 'debug', \$debug, 70 75 'maxdocs/\d+/', \$maxdocs)) { 71 76 &print_usage(); … … 133 138 134 139 # read the archive information file 135 $archive_info_filename = &util::filename_cat ($archivedir, "archives.inf"); 136 $archive_info = new arcinfo (); 137 $archive_info->load_info ($archive_info_filename); 140 if (!$debug) { 141 $archive_info_filename = &util::filename_cat ($archivedir, "archives.inf"); 142 $archive_info = new arcinfo (); 143 $archive_info->load_info ($archive_info_filename); 138 144 139 # create a docsave object to process the documents 140 $processor = new docsave ($collection, $archive_info, $verbosity, $gzip); 141 $processor->setarchivedir ($archivedir); 145 # create a docsave object to process the documents 146 $processor = new docsave ($collection, $archive_info, $verbosity, $gzip); 147 $processor->setarchivedir ($archivedir); 148 } else { 149 $processor = new docprint (); 150 } 142 151 143 152 # process the import directory … … 146 155 147 156 # write out the archive information file 148 $archive_info->save_info($archive_info_filename); 157 if (!$debug) { 158 $archive_info->save_info($archive_info_filename); 159 } 149 160 }
Note:
See TracChangeset
for help on using the changeset viewer.