]> git.donarmstrong.com Git - debbugs.git/commitdiff
Fix addition of correspondents in gen-indices (closes: #511850)
authorDon Armstrong <don@donarmstrong.com>
Thu, 15 Jan 2009 22:35:41 +0000 (14:35 -0800)
committerDon Armstrong <don@donarmstrong.com>
Thu, 15 Jan 2009 22:35:41 +0000 (14:35 -0800)
debian/changelog
scripts/gen-indices

index 09f23e173e9804662073f1a4ad41eebf9a7ee0a4..a7b42034d3bbcb80827fac63fe1874312afe9ef0 100644 (file)
@@ -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
index 0e34ce80aa81c4b9ca4a0b824cd3bf91f4219c1f..c929db6544565649c3b7a2d85c30232a2fc81fdc 100755 (executable)
@@ -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: $@";