From: Don Armstrong Date: Wed, 13 Dec 2006 07:41:57 +0000 (-0800) Subject: * Use the Debbugs:: modules in gen-indices X-Git-Tag: release/2.6.0~585^2^2~53 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=35c68236312af86d239c34a8b428e0464780bafb;p=debbugs.git * Use the Debbugs:: modules in gen-indices * Use the configuration file to determine the location of the spool * Split on email addresses separated by a comma properly --- diff --git a/scripts/gen-indices.in b/scripts/gen-indices.in index d60c8a9a..6fc8a182 100755 --- a/scripts/gen-indices.in +++ b/scripts/gen-indices.in @@ -4,8 +4,6 @@ # 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/; @@ -77,16 +75,14 @@ GetOptions(\%options,'quick!','index_path|index-path=s','debug|d+','help|h|?','m 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); +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 = ""; @@ -186,7 +182,7 @@ while (my $dir = shift @dirs) { 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"}); } }