From: cjwatson <> Date: Wed, 4 Jan 2006 20:05:29 +0000 (-0800) Subject: [project @ 2006-01-04 12:05:29 by cjwatson] X-Git-Tag: release/2.6.0~632 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f5c11f5d61f50d9c854a219adbfeec832f6fbeca;p=debbugs.git [project @ 2006-01-04 12:05:29 by cjwatson] add fallbacks for querying a source package by version when there's no binary package of the same name --- diff --git a/cgi/common.pl b/cgi/common.pl index 7bd76d26..4c64ad60 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -913,6 +913,10 @@ sub makesourceversions { my $pkgsrc = getpkgsrc(); if (exists $pkgsrc->{$pkg}) { @srcinfo = ([$pkgsrc->{$pkg}, $version]); + } elsif (getsrcpkgs($pkg)) { + # If we're looking at a source package that doesn't have + # a binary of the same name, just try the same version. + @srcinfo = ([$pkg, $version]); } else { next; } @@ -972,7 +976,15 @@ sub getversions { for my $ar (keys %{$_versions{$pkg}{$dist}}) { $uniq{$_versions{$pkg}{$dist}{$ar}} = 1 unless $ar eq 'source'; } - return keys %uniq; + if (%uniq) { + return keys %uniq; + } elsif (exists $_versions{$pkg}{$dist}{source}) { + # Maybe this is actually a source package with no corresponding + # binaries? + return $_versions{$pkg}{$dist}{source}; + } else { + return (); + } } }