]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2001-02-19 08:45:15 by ajt]
authorajt <>
Mon, 19 Feb 2001 16:45:15 +0000 (08:45 -0800)
committerajt <>
Mon, 19 Feb 2001 16:45:15 +0000 (08:45 -0800)
removed unused index-query api thing
added some not very interesting debugging code

cgi/common.pl
cgi/pkgreport.cgi

index dfb0f29772a452f1c83366a0a0f3672cd9c795f0..11517de2d0befa14e1ed02d8e3763f31480d4e3f 100644 (file)
@@ -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(<I>) 
     {
         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(<I>) { 
-        $descstr{ $1 } = 1 if (m/^(\S+)/);
-    }
-    close(I);
-    return %descstr;
-}
-
 sub emailfromrfc822 {
     my $email = shift;
     $email =~ s/\s*\(.*\)\s*//;
index b6486a78d2ae425b0865cddada4ca01751e4d1d6..2e17094978652ce5a52290b3dfd1fdf357e71c51 100755 (executable)
@@ -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);