2 # $Id: rebuild.in,v 1.4 2001/08/16 17:51:33 doogie Exp $
4 # Load modules and set envirnment
6 $config_path = '/org/bugs.debian.org/etc';
7 $lib_path = '/org/bugs.debian.org/scripts';
9 require("$config_path/config");
10 require("$lib_path/errorlib");
11 $ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
13 chdir("$gSpoolDir") || die "chdir spool: $!\n";
19 open(S,"$path/$lref.status") || die "unable to open $path/$lref: $!\n";
20 chop($s_originator= <S>);
22 chop($s_subject= <S>);
24 chop($s_package= <S>);
25 chop($s_keywords= <S>);
27 chop($s_forwarded= <S>);
28 chop($s_mergedwith= <S>);
29 chop($s_severity= <S>);
36 defined($startdate= time) || &quit("failed to get time: $!");
38 @ARGV==0 or &quit( "no archive given on the commandline" );
39 $archive= shift(@ARGV);
40 open IDXFILE, "> index.$archive" or &quit( "trying to reset index file: $!" );
43 if ( $archive eq 'db' )
45 opendir(DIR,'db') || next;
46 @list= grep(m/^\d+\.status$/,readdir(DIR));
48 grep(s/\.status$//,@list);
49 @list= sort { $a <=> $b } @list;
51 #process each bug (ie, status file)
52 while ( defined( $list[0] ))
53 { my $ref = shift @list;
54 print STDERR "$ref considering\n" if $debug;
55 readreport($ref, $path);
56 printf IDXFILE "%s %d %s\n", $s_package, $ref, $s_subject;
62 #get list of bugs (ie, status files)
63 for ($subdir=0; $subdir<100; $subdir++ )
65 my $path = sprintf( "$archive/%.2d", $subdir );
66 opendir(DIR,$path) || next;
67 @list= grep(m/^\d+\.status$/,readdir(DIR));
69 grep(s/\.status$//,@list);
70 @list= sort { $a <=> $b } @list;
72 #process each bug (ie, status file)
73 while ( defined( $list[0] ))
74 { my $ref = shift @list;
75 print STDERR "$ref considering\n" if $debug;
76 readreport($ref, $path);
77 printf IDXFILE "%s %d %s\n", $s_package, $ref, $s_subject;