]> git.donarmstrong.com Git - debbugs.git/blobdiff - scripts/rebuild.in
[project @ 2003-08-23 15:12:57 by cjwatson]
[debbugs.git] / scripts / rebuild.in
index fd1dbfbc6b7e48525cfc0a8928ec2b0901e03943..6c98f2545dba5f87bc325b2df921ba4a5d6b6f2e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# $Id: rebuild.in,v 1.9 2003/05/25 13:13:18 cjwatson Exp $
+# $Id: rebuild.in,v 1.13 2003/08/23 15:12:57 cjwatson Exp $
 
 # Load modules and set environment
 use File::Copy;
@@ -8,6 +8,8 @@ $lib_path = '/usr/lib/debbugs';
 
 require("$config_path/config");
 require("$lib_path/errorlib");
+use vars qw($gSpoolDir);
+
 $ENV{'PATH'} = $lib_path.':'.$ENV{'PATH'};
 
 chdir("$gSpoolDir") || die "chdir spool: $!\n";
@@ -16,8 +18,10 @@ chdir("$gSpoolDir") || die "chdir spool: $!\n";
 $debug = 0;
 
 @ARGV==0 and &quit( "no archive given on the commandline" );
-$archive= shift(@ARGV);
-open IDXFILE, "> index.$archive" or &quit( "trying to reset index file: $!" );
+my $archive = shift(@ARGV);
+my $index = "index.$archive";
+$index = 'index.db' if $archive eq 'db-h';
+open IDXFILE, "> $index" or &quit( "trying to reset index file: $!" );
 
 #get list of bugs (ie, status files)
 my @files;
@@ -25,9 +29,9 @@ for ($subdir=0; $subdir<100; $subdir++ )
 {
     my $path = sprintf( "$archive/%.2d", $subdir );
     opendir(DIR,$path) || next; 
-    my @list= grep(m/^\d+\.status$/,readdir(DIR));
+    my @list= grep(m/^\d+\.summary$/,readdir(DIR));
     closedir DIR;
-    grep(s/\.status$//,@list);
+    grep(s/\.summary$//,@list);
     push @files, @list;
 }