# Copyright (c) 2005/08/03 Anthony Towns
# GPL v2
-#use strict;
-
use DB_File;
use MLDBM qw(DB_FILE Storable);
use Fcntl qw/O_RDWR O_CREAT O_TRUNC/;
pod2usage(1) if $options{help};
pod2usage(-verbose=>2) if $options{man};
-{ no warnings;
- no strict;
-require '/etc/debbugs/config';
-require '/org/bugs.debian.org/scripts/errorlib';
-}
+use Debbugs::Config qw(:config);
+use Debbugs::Common qw(getparsedaddrs getbugcomponent);
+use Debbugs::Status qw(readbug);
-chdir('/org/bugs.debian.org/spool') or die "chdir spool: $!\n";
+chdir($config{spool_dir}) or die "chdir $config{spool_dir} failed: $!";
my $verbose = $options{debug};
-my $indexdest = $options{index_path} || "/org/bugs.debian.org/spool";
+my $indexdest = $options{index_path} || $config{spool_dir};
my $initialdir = "db-h";
my $suffix = "";
}
# NB: The reverse index is special; it's used to clean up during updates to bugs
-my @indexes = ('package', 'tag', 'severity', 'submitter-email','reverse');
+my @indexes = ('package', 'tag', 'severity','owner','submitter-email','reverse');
my $indexes;
my %slow_index = ();
my %fast_index = ();
addbugtoindex("package", $bug, split /[\s,]+/, $fdata->{"package"});
addbugtoindex("tag", $bug, split /[\s,]+/, $fdata->{"keywords"});
addbugtoindex('submitter-email', $bug,
- emailfromrfc822($fdata->{"originator"}));
+ map {$_->address} getparsedaddrs($fdata->{originator}));
addbugtoindex("severity", $bug, $fdata->{"severity"});
+ addbugtoindex("owner", $bug, $fdata->{"owner"});
}
}
# We do this, because old versions of touch don't support -d '@epoch'
system('touch','-d',"1/1/1970 UTC + ${start_time}secs","$indexdest/by-$i$suffix.idx");
}
+