]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2001-11-17 06:31:40 by doogie]
authordoogie <>
Sat, 17 Nov 2001 14:31:40 +0000 (06:31 -0800)
committerdoogie <>
Sat, 17 Nov 2001 14:31:40 +0000 (06:31 -0800)
* Add new sub to common.pl(getsrcpkgs), that, when given source package,
returnsr a list of all packages that come from that source.
* Modified pkgreport.cgi to use getsrcpkgs
* Modified the call to getbugs(), so that it could use the package index.

cgi/common.pl
cgi/pkgreport.cgi

index e80d4889f7bfd6ca3c96207ef6b515d4ef83af54..9ae3acb6291a20ab08ac3f462f7506309b8af642 100644 (file)
@@ -451,6 +451,17 @@ sub getbugstatus {
     return \%status;
 }
 
+sub getsrcpkgs {
+    my $src = shift;
+
+    my %pkgsrc = %{getpkgsrc()};
+    my @pkgs;
+    foreach ( keys %pkgsrc ) {
+       push @pkgs, $_ if $pkgsrc{$_} eq $src;
+    }
+    return @pkgs;
+}
+   
 sub buglog {
     my $bugnum = shift;
 
index 39049a0af8beedbe94ef5f71fc2b5527e015ec2c..ec85d4321a282601e36d1ecfe6c03ffaeddb0d6c 100755 (executable)
@@ -63,7 +63,7 @@ if (defined $pkg) {
 } elsif (defined $src) {
   $tag = "source $src";
   my %pkgsrc = %{getpkgsrc()};
-  @bugs = @{getbugs(sub { my %d=@_; return $src eq $d{"pkg"} || ( defined( $pkgsrc{$d{"pkg"}} ) && $src eq $pkgsrc{$d{"pkg"}} ) }, 'source', $src) };
+  @bugs = @{getbugs(sub {my %d=@_; return $pkg eq $d{"pkg"}}, 'package', getsrcpkgs($src))};
 } elsif (defined $maint) {
   my %maintainers = %{getmaintainers()};
   $tag = "maintainer $maint";
@@ -131,11 +131,8 @@ if (defined $pkg || defined $src) {
               . htmlsanit($maint) . "</a>.</p>\n";
     }
     my %pkgsrc = %{getpkgsrc()};
-    my @pkgs;
-    $src = $pkgsrc{ $pkg } if ( $pkg && !$src );
-    foreach ( keys %pkgsrc ) {
-       push @pkgs, $_ if $pkgsrc{$_} eq $src && ( ( $pkg && !( $_ eq $pkg ) ) || ( !$pkg && $src ) );
-    }
+    my @pkgs = getsrcpkgs($pkg ? $pkgsrc{ $pkg } : $src);
+    @pkgs = grep( !/^$pkg$/, @pkgs ) if ( $pkg );
     if ( @pkgs ) {
        @pkgs = sort @pkgs;
        if ($pkg) {
@@ -148,7 +145,7 @@ if (defined $pkg || defined $src) {
     }
     if ($pkg) {
        my $stupidperl = ${debbugs::gPackagePages};
-       printf "<p>You might like to refer to the <a href=\"%s\">%s package page</a>, or to the source package <a href=\"%s\">%s</a>'s bug page.</p>\n", urlsanit("http://${debbugs::gPackagePages}/$pkg"), htmlsanit("$pkg"), urlsanit(srcurl($src)), $src;
+       printf "<p>You might like to refer to the <a href=\"%s\">%s package page</a>, or to the source package <a href=\"%s\">%s</a>'s bug page.</p>\n", urlsanit("http://${debbugs::gPackagePages}/$pkg"), htmlsanit("$pkg"), urlsanit(srcurl($pkg)), $pkgsrc{$pkg};
     }
 } elsif (defined $maint || defined $maintenc) {
     print "<p>Note that maintainers may use different Maintainer fields for\n";