2 # $Id: rebuild.in,v 1.1 1999/09/20 05:40:07 gecko Exp $
4 # Load modules and set envirnment
6 require('/etc/debbugs/config');
7 require('/usr/lib/debbugs/errorlib');
8 $ENV{'PATH'}= '/usr/lib/debbugs'.$ENV{'PATH'};
9 chdir("$gSpoolDir") || die "chdir spool: $!\n";
15 open(S,"$path/$lref.status") || die "unable to open $path/$lref: $!\n";
16 chop($s_originator= <S>);
18 chop($s_subject= <S>);
20 chop($s_package= <S>);
21 chop($s_keywords= <S>);
23 chop($s_forwarded= <S>);
24 chop($s_mergedwith= <S>);
25 chop($s_severity= <S>);
32 defined($startdate= time) || &quit("failed to get time: $!");
34 open IDXFILE, ">archive/index" or &quit( "trying to reset index file: $!" );
36 #get list of bugs (ie, status files)
37 for ($subdir=0; $subdir<100; $subdir++ )
39 my $path = sprintf( "archive/%.2d", $subdir );
40 opendir(DIR,$path) || next;
41 @list= grep(m/^\d+\.status$/,readdir(DIR));
43 grep(s/\.status$//,@list);
44 @list= sort { $a <=> $b } @list;
46 #process each bug (ie, status file)
47 while ( defined( $list[0] ))
48 { my $ref = shift @list;
49 print STDERR "$ref considering\n" if $debug;
50 readreport($ref, $path);
51 printf IDXFILE "%s %d %s\n", $s_package, $ref, $s_subject;