From 8e1a4412aaae391ff8ef27ae90cd5fe53e685d19 Mon Sep 17 00:00:00 2001
From: Don Armstrong <don@donarmstrong.com>
Date: Mon, 1 Feb 2010 09:23:20 -0800
Subject: [PATCH] Fix links to PTS pages for src packages (closes: #566089).
 Thanks to Sandro Tosi.

---
 Debbugs/CGI/Pkgreport.pm | 4 +++-
 debian/changelog         | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Debbugs/CGI/Pkgreport.pm b/Debbugs/CGI/Pkgreport.pm
index 57d1cc4d..d047affb 100644
--- a/Debbugs/CGI/Pkgreport.pm
+++ b/Debbugs/CGI/Pkgreport.pm
@@ -74,7 +74,7 @@ sub generate_package_info{
 			       spec  => {binary => {type => BOOLEAN,
 						    default => 1,
 						   },
-					 package => {type => SCALAR|ARRAYREF,
+					 package => {type => SCALAR,#|ARRAYREF,
 						    },
 					 options => {type => HASHREF,
 						    },
@@ -142,6 +142,8 @@ sub generate_package_info{
 	  if (defined $config{subscription_domain} and
 	      length $config{subscription_domain}) {
 	       my $ptslink = $param{binary} ? $srcforpkg : $package;
+	       # the pts only wants the source, and doesn't care about src: (#566089)
+	       $ptslink =~ s/^src://;
 	       push @references, q(to the <a href="http://).html_escape("$config{subscription_domain}/$ptslink").q(">Package Tracking System</a>);
 	  }
 	  # Only output this if the source listing is non-trivial.
diff --git a/debian/changelog b/debian/changelog
index 4618e6e7..56ac6cc4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ debbugs (2.4.2~exp1) experimental; urgency=low
     (closes: #565981). Thanks to Mike Hommey
   * Allow type to be text as well as text/(something not html)
     (closes: #566068). Thanks to Mike Hommey.
+  * Fix links to PTS pages for src packages (closes: #566089). Thanks to
+    Sandro Tosi.
 
  -- Don Armstrong <don@debian.org>  Wed, 26 Aug 2009 21:32:53 -0700
 
-- 
2.39.5