From 63490635cc6313930c44c86d2f3b53031c8c4d23 Mon Sep 17 00:00:00 2001
From: Don Armstrong <don@donarmstrong.com>
Date: Mon, 1 Feb 2010 09:34:31 -0800
Subject: [PATCH] Fix affects for source packages (closes: #563470). Thanks to
 Charles Plessy.

---
 cgi/pkgreport.cgi | 7 ++++---
 debian/changelog  | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi
index 2efc87c8..3fc500b3 100755
--- a/cgi/pkgreport.cgi
+++ b/cgi/pkgreport.cgi
@@ -363,10 +363,11 @@ my $title = $gBugs.' '.join(' and ', map {/ or /?"($_)":$_} @title);
 # shove in bugs which affect this package if there is a package or a
 # source given (by default), but no affects options given
 if (not exists $param{affects} and not exists $param{noaffects} and
-    (exists $param{source} or
+    (exists $param{src} or
      exists $param{package})) {
-    push @bugs, get_bugs((map {exists $param{$_}?($_ =~ /^(?:package|source)$/?'affects':$_,
-						  ($_ eq 'source'?'src:'.$param{$_}:$param{$_})):()}
+    push @bugs, get_bugs((map {my $key = $_;
+			       exists $param{$key}?($key =~ /^(?:package|src)$/?'affects':$key,
+						  ($key eq 'src'?[map {"src:$_"}make_list($param{$key})]:$param{$_})):()}
 			  grep {$_ ne 'newest'}
 			  keys %package_search_keys, 'archive'),
 			 usertags => \%ut,
diff --git a/debian/changelog b/debian/changelog
index 56ac6cc4..d19a5542 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,8 @@ debbugs (2.4.2~exp1) experimental; urgency=low
     (closes: #566068). Thanks to Mike Hommey.
   * Fix links to PTS pages for src packages (closes: #566089). Thanks to
     Sandro Tosi.
+  * Fix affects for source packages (closes: #563470). Thanks to Charles
+    Plessy.
 
  -- Don Armstrong <don@debian.org>  Wed, 26 Aug 2009 21:32:53 -0700
 
-- 
2.39.5