From: ajt <> Date: Mon, 19 Feb 2001 16:45:15 +0000 (-0800) Subject: [project @ 2001-02-19 08:45:15 by ajt] X-Git-Tag: release/2.6.0~1155 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7ea7f785614a6e5217a1d7d743354072f4071b1f;p=debbugs.git [project @ 2001-02-19 08:45:15 by ajt] removed unused index-query api thing added some not very interesting debugging code --- diff --git a/cgi/common.pl b/cgi/common.pl index dfb0f29..11517de 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -5,6 +5,8 @@ my $common_repeatmerged = 1; my %common_include = (); my %common_exclude = (); +my $debug = 0; + sub set_option { my ($opt, $val) = @_; if ($opt eq "archive") { $common_archive = $val; } @@ -31,6 +33,7 @@ sub readparse { $val=~s/%(..)/pack("c",hex($1))/ge; $ret{$key}=$val; } +$debug = 1 if ($ret{"debug"} eq "aj"); return %ret; } @@ -266,50 +269,6 @@ sub htmlizebugs { return $result; } -sub submitterbugs { - my $submitter = shift; - my $chk = sub { - my %d = @_; - ($subemail = $d{"submitter"}) =~ s/\s*\(.*\)\s*//; - if ($subemail =~ m/<(.*)>/) { $subemail = $1 } - return $subemail eq $submitter; - }; - return getbugs($chk); -} - -sub severitybugs { - my $status = shift; - my $severity = shift; - my $chk = sub { - my %d = @_; - return ($d{"severity"} eq $severity) && ($d{"status"} eq $status); - }; - return getbugs($chk); -} - -sub maintbugs { - my $maint = shift; - my %maintainers = getmaintainers(); - my $chk = sub { - my %d = @_; - ($maintemail = $maintainers{$d{"pkg"}} || "") =~ s/\s*\(.*\)\s*//; - if ($maintemail =~ m/<(.*)>/) { $maintemail = $1 } - return $maintemail eq $maint; - }; - return getbugs($chk); -} - -sub maintencbugs { - my $maintenc = shift; - my %maintainers = getmaintainers(); - return getbugs(sub {my %d=@_; return maintencoded($maintainers{$d{"pkg"}} || "") eq $maintenc}); -} - -sub pkgbugs { - my $inpkg = shift; - return getbugs( sub { my %d = @_; return $inpkg eq $d{"pkg"} }); -} - sub countbugs { my $bugfunc = shift; if ($common_archive) { @@ -341,6 +300,7 @@ sub getbugs { } my @result = (); +print STDERR "here start getbugs\n" if ($debug); while() { if (m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*([^]]*)\s*\]\s+(\w+)\s+(.*)$/) { @@ -353,23 +313,10 @@ sub getbugs { } } close I; +print STDERR "here end getbugs\n" if ($debug); return sort {$a <=> $b} @result; } -sub pkgbugsindex { - my %descstr = (); - if ( $common_archive ) { - open I, "<$debbugs::gSpoolDir/index.archive" or &quit("bugindex: $!"); - } else { - open I, "<$debbugs::gSpoolDir/index.db" or &quit("bugindex: $!"); - } - while() { - $descstr{ $1 } = 1 if (m/^(\S+)/); - } - close(I); - return %descstr; -} - sub emailfromrfc822 { my $email = shift; $email =~ s/\s*\(.*\)\s*//; diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index b6486a7..2e17094 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -59,11 +59,9 @@ my $tag; my @bugs; if (defined $pkg) { $tag = "package $pkg"; - #@bugs = pkgbugs($pkg); @bugs = getbugs(sub {my %d=@_; return $pkg eq $d{"pkg"}}); } elsif (defined $maint) { $tag = "maintainer $maint"; - #@bugs = maintbugs($maint); @bugs = getbugs(sub {my %d=@_; my $me; ($me = $maintainers{$d{"pkg"}}||"") =~ s/\s*\(.*\)\s*//; $me = $1 if ($me =~ m/<(.*)>/); @@ -71,14 +69,12 @@ if (defined $pkg) { }) } elsif (defined $maintenc) { $tag = "encoded maintainer $maintenc"; - #@bugs = maintencbugs($maintenc); @bugs = getbugs(sub {my %d=@_; return maintencoded($maintainers{$d{"pkg"}} || "") eq $maintenc }); } elsif (defined $submitter) { $tag = "submitter $submitter"; - #@bugs = submitterbugs($submitter); @bugs = getbugs(sub {my %d=@_; my $se; ($se = $d{"submitter"} || "") =~ s/\s*\(.*\)\s*//; $se = $1 if ($se =~ m/<(.*)>/); @@ -86,7 +82,6 @@ if (defined $pkg) { }); } elsif (defined $severity) { $tag = "$status $severity bugs"; - #@bugs = severitybugs($status, $severity); @bugs = getbugs(sub {my %d=@_; return ($d{"severity"} eq $severity) && ($d{"status"} eq $status);