Changeset 1252
- Timestamp:
- 2000-06-29T11:28:17+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/mgbuilder.pm
r1251 r1252 654 654 $build_cfg->{'numbytes'} = $self->{'buildproc'}->get_num_bytes(); 655 655 656 # get additional stats from mg 657 my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}"; 658 my $exe = &util::get_os_exe (); 659 my $mgstat_exe = &util::filename_cat($exedir, "mgstat$exe"); 660 my $input_file = &util::filename_cat ("text", $self->{'collection'}); 661 if (!-e "$mgstat_exe" || !open (PIPEIN, "$mgstat_exe -d $self->{'build_dir'} -f $input_file |")) { 662 print STDERR "Warning: Couldn't open pipe to $mgstat_exe to get additional stats\n"; 663 } else { 664 my $line = ""; 665 while (defined ($line = <PIPEIN>)) { 666 if ($line =~ /^Words in collection \[dict\]\s+:\s+(\d+)/) { 667 ($build_cfg->{'numwords'}) = $1; 668 } elsif ($line =~ /^Documents\s+:\s+(\d+)/) { 669 ($build_cfg->{'numsections'}) = $1; 670 } 671 } 672 close PIPEIN; 673 } 674 656 675 # store the mapping between the index names and the directory names 657 676 my @indexmap = (); … … 679 698 # write out the build information 680 699 &cfgread::write_cfg_file("$self->{'build_dir'}/build.cfg", $build_cfg, 681 '^(builddate|numdocs|numbytes )$',700 '^(builddate|numdocs|numbytes|numwords|numsections)$', 682 701 '^(indexmap|subcollectionmap|languagemap|notbuilt)$'); 683 702
Note:
See TracChangeset
for help on using the changeset viewer.