From 6617fa4e20357b7c2bb9f5990984b08d4f827089 Mon Sep 17 00:00:00 2001
From: Don Armstrong <don@donarmstrong.com>
Date: Tue, 2 Jan 2018 11:26:59 -0800
Subject: [PATCH] pass through a binary-to-source cache

---
 Debbugs/CGI/Pkgreport.pm | 2 ++
 Debbugs/Status.pm        | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/Debbugs/CGI/Pkgreport.pm b/Debbugs/CGI/Pkgreport.pm
index e64300ad..6f29e931 100644
--- a/Debbugs/CGI/Pkgreport.pm
+++ b/Debbugs/CGI/Pkgreport.pm
@@ -350,12 +350,14 @@ sub pkg_htmlizebugs {
 	  push @{$exclude{$key}}, split /\s*,\s*/, $value;
      }
 
+     my $binary_to_source_cache = {};
      foreach my $bug (@bugs) {
 	  my %status = %{get_bug_status(bug=>$bug,
 					(exists $param{dist}?(dist => $param{dist}):()),
 					bugusertags => $param{bugusertags},
 					(exists $param{version}?(version => $param{version}):()),
 					(exists $param{arch}?(arch => $param{arch}):(arch => $config{default_architectures})),
+					binary_to_source_cache => $binary_to_source_cache,
 				       )};
 	  next unless %status;
 	  next if bug_filter(bug => $bug,
diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm
index 4b8d82e8..197b188a 100644
--- a/Debbugs/Status.pm
+++ b/Debbugs/Status.pm
@@ -1220,6 +1220,9 @@ sub get_bug_status {
 					  indicatesource => {type => BOOLEAN,
 							     default => 1,
 							    },
+					  binary_to_source_cache => {type => HASHREF,
+								     optional => 1,
+								    },
 					 },
 			      );
      my %status;
@@ -1254,6 +1257,8 @@ sub get_bug_status {
 
      $status{source} = binary_to_source(binary=>[split /\s*,\s*/, $status{package}],
 					source_only => 1,
+					exists $param{binary_to_source_cache}?
+					(cache =>$param{binary_to_source_cache}):(),
 				       );
 
      $status{"package"} = 'unknown' if ($status{"package"} eq '');
-- 
2.39.5