]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2006-01-04 12:05:29 by cjwatson]
authorcjwatson <>
Wed, 4 Jan 2006 20:05:29 +0000 (12:05 -0800)
committercjwatson <>
Wed, 4 Jan 2006 20:05:29 +0000 (12:05 -0800)
add fallbacks for querying a source package by version when there's no binary package of the same name

cgi/common.pl

index 7bd76d26bf2d8c88f0999f2a21280329b27b501b..4c64ad6027cecee93d315c7f435cc7230b596b3c 100644 (file)
@@ -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 ();
+        }
     }
 }