Changeset 7904
- Timestamp:
- 2004-08-06T16:38:44+12:00 (20 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/arcinfo.pm
r3416 r7904 48 48 49 49 $self->{'info'} = {}; 50 50 51 51 if (-e $filename) { 52 52 open (INFILE, $filename) || … … 61 61 } 62 62 } 63 64 63 close (INFILE); 65 64 } … … 74 73 open (OUTFILE, ">$filename") || 75 74 die "arcinfo::save_info couldn't write $filename\n"; 76 75 77 76 foreach $info (@{$self->get_OID_list()}) { 78 77 if (defined $info) { … … 80 79 } 81 80 } 82 83 81 close (OUTFILE); 84 82 } -
trunk/gsdl/perllib/mgbuilder.pm
r7150 r7904 158 158 } 159 159 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $verbosity, $outhandle, $failhandle, \@global_opts); 160 160 161 if (scalar(@{$self->{'pluginfo'}}) == 0) { 161 162 print $outhandle "No plugins were loaded.\n"; … … 191 192 $buildproctype = "mgbuildproc"; 192 193 } 194 193 195 require "$buildprocdir/$buildproctype.pm"; 194 196 … … 264 266 $self->{'buildproc'}->set_index ($textindex); 265 267 $self->{'buildproc'}->set_indexing_text (0); 268 269 266 270 if ($self->{'no_text'}) { 267 271 $self->{'buildproc'}->set_store_text(0); … … 270 274 } 271 275 $self->{'buildproc'}->reset(); 276 272 277 &plugin::begin($self->{'pluginfo'}, $self->{'source_dir'}, 273 278 $self->{'buildproc'}, $self->{'maxdocs'}); … … 275 280 "", {}, $self->{'buildproc'}, $self->{'maxdocs'}); 276 281 &plugin::end($self->{'pluginfo'}); 282 277 283 278 284 close ($handle) unless $self->{'debug'}; … … 311 317 &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'}, 312 318 "", {}, $self->{'buildproc'}, $self->{'maxdocs'}); 319 313 320 close ($handle) unless $self->{'debug'}; 314 321 … … 635 642 "", {}, $self->{'buildproc'}, $self->{'maxdocs'}); 636 643 644 637 645 $self->print_stats (); 638 646 … … 925 933 my $num_bytes = $self->{'buildproc'}->get_num_bytes(); 926 934 my $num_processed_bytes = $self->{'buildproc'}->get_num_processed_bytes(); 927 935 928 936 if ($indexing_text) { 929 937 print $outhandle "Stats (Creating index $index)\n"; … … 933 941 print $outhandle "Total bytes in collection: $num_bytes\n"; 934 942 print $outhandle "Total bytes in $index: $num_processed_bytes\n"; 935 943 936 944 if ($num_processed_bytes < 50 && ($indexing_text || !$self->{'no_text'})) { 937 945 print $outhandle "***************\n"; … … 948 956 949 957 1; 958 959 960 -
trunk/gsdl/perllib/mgppbuilder.pm
r7150 r7904 305 305 my $basefilename = "text/$self->{'collection'}"; 306 306 my $fulltextprefix = &util::filename_cat ($self->{'build_dir'}, $basefilename); 307 307 308 308 my $osextra = ""; 309 309 if ($ENV{'GSDLOS'} =~ /^windows$/i) { -
trunk/gsdl/perllib/plugin.pm
r7829 r7904 83 83 } 84 84 $options =~ s/\$/\\\$/g; 85 85 86 86 eval ("\$plugobj = new \$pluginname($options)"); 87 87 die "$@" if $@; … … 100 100 sub begin { 101 101 my ($pluginfo, $base_dir, $processor, $maxdocs) = @_; 102 102 103 103 104 map { $_->begin($pluginfo, $base_dir, $processor, $maxdocs); } @$pluginfo; … … 106 107 sub read { 107 108 my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $gli, $aux) = @_; 109 108 110 109 111 $maxdocs = -1 unless defined $maxdocs && $maxdocs =~ /\d/; 110 112 $gli = 0 unless defined $gli; 111 113 114 112 115 my $rv = 0; 113 116 my $glifile = $file; 117 114 118 $glifile =~ s/^[\/\\]+//; # file sometimes starts with a / so get rid of it 115 119 # Announce to GLI that we are handling a file 116 120 print STDERR "<File n='$glifile'>\n" if $gli; 117 121 122 118 123 # the .kill file is a handy (if not very elegant) way of aborting 119 124 # an import.pl or buildcol.pl process … … 134 139 $rv = $plugobj->read($pluginfo, $base_dir, $file, 135 140 $metadata, $processor, $maxdocs, $gli, $aux); 136 141 if (defined $rv) { 137 142 if ($rv == -1) { 138 143 # an error has occurred 139 144 $had_error = 1; 140 145 print STDERR "<ProcessingError n='$glifile'>\n" if $gli; 141 146 } else { 142 147 return $rv; 143 148 } 144 149 } # else undefined - was not recognised by the plugin 145 150 } 146 151 147 152 if ($had_error) { 148 153 # was recognised but couldn't be processed … … 152 157 # tell the GLI that it was not processed 153 158 print STDERR "<NonProcessedFile n='$glifile'>\n" if $gli; 154 159 155 160 $file =~ s/.*?([^\\\/]+)$/$1/; 156 161 gsprintf($failhandle, "$file: {plugin.no_plugin_could_process_this_file}\n");
Note:
See TracChangeset
for help on using the changeset viewer.