From: Don Armstrong Date: Thu, 15 Jan 2009 22:35:41 +0000 (-0800) Subject: Fix addition of correspondents in gen-indices (closes: #511850) X-Git-Tag: release/2.6.0~461^2~68 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1aaf096755dfe44e5d9077855f0c52df4fdeffd7;hp=89c921ea1cc1577e381843348fe54c802cf10dfc;p=debbugs.git Fix addition of correspondents in gen-indices (closes: #511850) --- diff --git a/debian/changelog b/debian/changelog index 09f23e1..a7b4203 100644 --- a/debian/changelog +++ b/debian/changelog @@ -220,6 +220,7 @@ debbugs (2.4.2) UNRELEASED; urgency=low * Link to packages in bugreport page (closes: #229067) * Totally revamp the pkgreport templates (closes: #434504) * Add correspondent option to track bug correpondents (closes: #485804) + * Fix addition of correspondents in gen-indices (closes: #511850) * Allow clicking anywhere outside the extra status box to close the extra status box (closes: #499990) Thanks to James Vega for the patch. * Return 404 when a bug number that does not exist is used diff --git a/scripts/gen-indices b/scripts/gen-indices index 0e34ce8..c929db6 100755 --- a/scripts/gen-indices +++ b/scripts/gen-indices @@ -208,15 +208,15 @@ while (my $dir = shift @dirs) { # handle log entries # do this in eval to avoid exploding on jacked logs eval { - my $log = Debbugs::Log->new(bug_num => $bug); - while (my $record = $log->read_record()) { - next unless $record->{type} eq 'incoming-recv'; - # we use a regex here, because a full mime parse will be slow. - my ($from) = $record->{text} =~ /^From:\s+(.+?)^\S/ism; - addbugtoindex('correspondent',$bug, - map {lc($_->address)} getparsedaddrs($from) - ); - } + my $log = Debbugs::Log->new(bug_num => $bug); + my @correspondents; + while (my $record = $log->read_record()) { + next unless $record->{type} eq 'incoming-recv'; + # we use a regex here, because a full mime parse will be slow. + my ($from) = $record->{text} =~ /^From:\s+(.+?)^\S/ism; + push @correspondents, map {lc($_->address)} getparsedaddrs($from); + } + addbugtoindex('correspondent',$bug,@correspondents) if @correspondents; }; if ($@) { print STDERR "Problem dealing with log of $bug: $@";