From 4633a18243187481c391a558178b2bafbaaf9ad8 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Tue, 7 Aug 2007 18:38:16 -0700 Subject: [PATCH] - Handle src/binary packages with the same name (but different src packages) correctly. (closes: #435926) --- Debbugs/Packages.pm | 12 +++++++++++- cgi/pkgreport.cgi | 17 ++++++++++------- debian/changelog | 2 ++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Debbugs/Packages.pm b/Debbugs/Packages.pm index b34e1b5..7103fc1 100644 --- a/Debbugs/Packages.pm +++ b/Debbugs/Packages.pm @@ -254,6 +254,11 @@ matching this version was uploaded =item source -- returns source/version instead of just versions +=item no_source_arch -- discards the source architecture when arch is +not passed. [Used for finding the versions of binary packages only.] +Defaults to 0, which does not discard the source architecture. (This +may change in the future, so if you care, please code accordingly.) + =back =cut @@ -277,6 +282,9 @@ sub get_versions{ source => {type => BOOLEAN, default => 0, }, + no_source_arch => {type => BOOLEAN, + default => 0, + }, }, ); my $versions; @@ -303,7 +311,9 @@ sub get_versions{ for my $dist (make_list($param{dist})) { for my $arch (exists $param{arch}? make_list($param{arch}): - (keys %{$version->{$dist}})) { + (grep {not $param{no_source_arch} or + $_ ne 'source' + } keys %{$version->{$dist}})) { next unless defined $version->{$dist}{$arch}; for my $ver (ref $version->{$dist}{$arch} ? keys %{$version->{$dist}{$arch}} : diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index 37f4196..48d755b 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -308,6 +308,7 @@ while (my ($key,$value) = splice @search_key_order, 0, 2) { (exists $param{dist}?(dist => $param{dist}):()), (exists $param{arch}?(arch => $param{arch}):()), ($key eq 'src'?(arch => q(source)):()), + no_source_arch => 1, ); my $verdesc = join(', ',@versions); $verdesc = 'version'.(@versions>1?'s ':' ').$verdesc; @@ -398,9 +399,17 @@ for my $package (make_list($param{src}||[])) { sub output_package_info{ my ($srcorbin,$package) = @_; + + my %pkgsrc = %{getpkgsrc()}; + my $srcforpkg = $package; + if ($srcorbin eq 'binary') { + $srcforpkg = $pkgsrc{$package}; + defined $srcforpkg or $srcforpkg = $package; + } + my $showpkg = html_escape($package); my $maintainers = getmaintainers(); - my $maint = $maintainers->{$package}; + my $maint = $maintainers->{$srcforpkg}; if (defined $maint) { print '

'; print htmlize_maintlinks(sub { $_[0] == 1 ? "Maintainer for $showpkg is " @@ -411,12 +420,6 @@ sub output_package_info{ } else { print "

No maintainer for $showpkg. Please do not report new bugs against this package.

\n"; } - my %pkgsrc = %{getpkgsrc()}; - my $srcforpkg = $package; - if ($srcorbin eq 'binary') { - $srcforpkg = $pkgsrc{$package}; - defined $srcforpkg or $srcforpkg = $package; - } my @pkgs = getsrcpkgs($srcforpkg); @pkgs = grep( !/^\Q$package\E$/, @pkgs ); if ( @pkgs ) { diff --git a/debian/changelog b/debian/changelog index 53b2b73..cd4aadc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -198,6 +198,8 @@ debbugs (2.4.2) UNRELEASED; urgency=low - Allow selecting the newest N bugs (closes: #84681) - Add anchor links to specific messages (closes: #431450) - Add missing newline after indicating what the user is (closes: #432466) + - Handle src/binary packages with the same name (but different src + packages) correctly. (closes: #435926) -- Colin Watson Fri, 20 Jun 2003 18:57:25 +0100 -- 2.39.2