my %common_include = ();
my %common_exclude = ();
+my $debug = 0;
+
sub set_option {
my ($opt, $val) = @_;
if ($opt eq "archive") { $common_archive = $val; }
$val=~s/%(..)/pack("c",hex($1))/ge;
$ret{$key}=$val;
}
+$debug = 1 if ($ret{"debug"} eq "aj");
return %ret;
}
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) {
}
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+(.*)$/) {
}
}
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*//;
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/<(.*)>/);
})
} 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/<(.*)>/);
});
} 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);