From f3e9030c5d22122dc4e7a4713b1c3413592a0d02 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 20 May 2009 09:27:22 -0700 Subject: [PATCH] * fix the src:package bits for bugreport.cgi --- Debbugs/CGI.pm | 2 +- cgi/bugreport.cgi | 18 ++++++++++++++---- templates/en_US/cgi/bugreport_pkginfo.tmpl | 7 ++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Debbugs/CGI.pm b/Debbugs/CGI.pm index 3285d52..d305aed 100644 --- a/Debbugs/CGI.pm +++ b/Debbugs/CGI.pm @@ -404,7 +404,7 @@ sub package_links { %options, $type => $_, ), - $_); + ($type eq 'src'?'src:':'').$_); } make_list($param{$type}) if exists $param{$type}; } for my $type (qw(maint owner submitter correspondent)) { diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index a151b21..790e1a2 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -292,10 +292,20 @@ my %package; my @packages = splitpackages($status{package}); foreach my $pkg (@packages) { - $package{$pkg} = {maintainer => exists($maintainer{$pkg}) ? $maintainer{$pkg} : '(unknown)', - exists($pkgsrc{$pkg}) ? (source => $pkgsrc{$pkg}) : (), - package => $pkg, - }; + if ($pkg =~ /^src\:/) { + my ($srcpkg) = $pkg =~ /^src:(.*)/; + $package{$pkg} = {maintainer => exists($maintainer{$srcpkg}) ? $maintainer{$srcpkg} : '(unknown)', + source => $srcpkg, + package => $pkg, + is_source => 1, + }; + } + else { + $package{$pkg} = {maintainer => exists($maintainer{$pkg}) ? $maintainer{$pkg} : '(unknown)', + exists($pkgsrc{$pkg}) ? (source => $pkgsrc{$pkg}) : (), + package => $pkg, + }; + } } # fixup various bits of the status diff --git a/templates/en_US/cgi/bugreport_pkginfo.tmpl b/templates/en_US/cgi/bugreport_pkginfo.tmpl index 4a39ba3..872aff4 100644 --- a/templates/en_US/cgi/bugreport_pkginfo.tmpl +++ b/templates/en_US/cgi/bugreport_pkginfo.tmpl @@ -1,14 +1,15 @@

{if (keys %package > 1) { q(Packages)} else {q(Package)}}: - {join(q(, ),package_links(package => [map {$_->{package}} values %package], + {join(q(, ),package_links(package => [map {$_->{package}} grep {!$_->{is_source}} values %package], + source => [map {$_->{source} } grep { $_->{is_source}} values %package], class => q(submitter), ) )}; {my $output =''; for my $package (values %package) { - $output .= q(Maintainer for ).package_links(package=>$package->{package}).qq( is ). + $output .= q(Maintainer for ).package_links($package->{is_source}?(source=>$package->{source}):(package=>$package->{package})).qq( is ). package_links(maintainer => $package->{maintainer}).qq(; ); - if (exists $package->{source}) { + if (exists $package->{source} and not $package->{is_source}) { $output .= q(Source for ).package_links(package=>$package->{package}).qq( is ). package_links(source => $package->{source}).qq(. ); } -- 2.39.2