* s/quit/quitcgi/, so that we don't get a clash between errorlib's quit.
* Use the helper functions from errorlib to find the bug's location and
path.
-my $ref = $param{'bug'} || quit("No bug number");
-$ref =~ /(\d+)/ or quit("Invalid bug number");
+my $ref = $param{'bug'} || quitcgi("No bug number");
+$ref =~ /(\d+)/ or quitcgi("Invalid bug number");
$ref = $1;
my $short = "#$ref";
my $msg = $param{'msg'} || "";
$ref = $1;
my $short = "#$ref";
my $msg = $param{'msg'} || "";
$descriptivehead .= ".\n<br>";
}
$descriptivehead .= ".\n<br>";
}
-open L, "<$buglog" or &quit("open log for $ref: $!");
+open L, "<$buglog" or &quitcgi("open log for $ref: $!");
if ($buglog !~ m#^\Q$gSpoolDir/db-h/#) {
$descriptivehead .= "\n<p>Bug is <strong>archived</strong>. No further changes may be made.</p>";
}
if ($buglog !~ m#^\Q$gSpoolDir/db-h/#) {
$descriptivehead .= "\n<p>Bug is <strong>archived</strong>. No further changes may be made.</p>";
}
|| m/^(kill-init|kill-end) (incoming-recv|autocheck|recips|html)$/
|| m/^kill-body go$/)
{
|| m/^(kill-init|kill-end) (incoming-recv|autocheck|recips|html)$/
|| m/^kill-body go$/)
{
- &quit("$ref: Transition from $normstate to $newstate at $linenum disallowed");
+ &quitcgi("$ref: Transition from $normstate to $newstate at $linenum disallowed");
}
#$this .= "\n<br>states: $normstate $newstate<br>\n";
}
#$this .= "\n<br>states: $normstate $newstate<br>\n";
my $pl= $_;
$pl =~ s/\n+$//;
m/^Received: \(at (\S+)\) by (\S+)\;/
my $pl= $_;
$pl =~ s/\n+$//;
m/^Received: \(at (\S+)\) by (\S+)\;/
- || &quit("bad line \`$pl' in state incoming-recv");
+ || &quitcgi("bad line \`$pl' in state incoming-recv");
$thisheader = "<h2>Message received at ".htmlsanit("$1\@$2")
. ":</h2>\n";
$this = '';
$thisheader = "<h2>Message received at ".htmlsanit("$1\@$2")
. ":</h2>\n";
$this = '';
next if !m/^$/;
$normstate= 'go-nox';
} else {
next if !m/^$/;
$normstate= 'go-nox';
} else {
- &quit("$ref state $normstate line \`$_'");
+ &quitcgi("$ref state $normstate line \`$_'");
-&quit("$ref state $normstate at end") unless $normstate eq 'kill-end';
+&quitcgi("$ref state $normstate at end") unless $normstate eq 'kill-end';
my $msg = shift;
print "Content-Type: text/html\n\n";
print "<HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>\n";
my $msg = shift;
print "Content-Type: text/html\n\n";
print "<HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>\n";
sub allbugs {
my @bugs = ();
sub allbugs {
my @bugs = ();
- opendir(D, "$debbugs::gSpoolDir/db") or &quit("opendir db: $!");
+ opendir(D, "$debbugs::gSpoolDir/db") or &quitcgi("opendir db: $!");
@bugs = sort {$a<=>$b} grep s/\.status$//,
(grep m/^[0-9]+\.status$/,
(readdir(D)));
@bugs = sort {$a<=>$b} grep s/\.status$//,
(grep m/^[0-9]+\.status$/,
(readdir(D)));
sub countbugs {
my $bugfunc = shift;
if ($common_archive) {
sub countbugs {
my $bugfunc = shift;
if ($common_archive) {
- open I, "<$debbugs::gSpoolDir/index.archive" or &quit("bugindex: $!");
+ open I, "<$debbugs::gSpoolDir/index.archive" or &quitcgi("bugindex: $!");
- open I, "<$debbugs::gSpoolDir/index.db" or &quit("bugindex: $!");
+ open I, "<$debbugs::gSpoolDir/index.db" or &quitcgi("bugindex: $!");
} else {
if ( $common_archive ) {
open I, "<$debbugs::gSpoolDir/index.archive"
} else {
if ( $common_archive ) {
open I, "<$debbugs::gSpoolDir/index.archive"
- or &quit("bugindex: $!");
+ or &quitcgi("bugindex: $!");
} else {
open I, "<$debbugs::gSpoolDir/index.db"
} else {
open I, "<$debbugs::gSpoolDir/index.db"
- or &quit("bugindex: $!");
+ or &quitcgi("bugindex: $!");
}
while(<I>) {
if (m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*([^]]*)\s*\]\s+(\w+)\s+(.*)$/) {
}
while(<I>) {
if (m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*([^]]*)\s*\]\s+(\w+)\s+(.*)$/) {
return $_maintainer if $_maintainer;
my %maintainer;
return $_maintainer if $_maintainer;
my %maintainer;
- open(MM,"$gMaintainerFile") or &quit("open $gMaintainerFile: $!");
+ open(MM,"$gMaintainerFile") or &quitcgi("open $gMaintainerFile: $!");
while(<MM>) {
next unless m/^(\S+)\s+(\S.*\S)\s*$/;
($a,$b)=($1,$2);
while(<MM>) {
next unless m/^(\S+)\s+(\S.*\S)\s*$/;
($a,$b)=($1,$2);
$maintainer{$a}= $b;
}
close(MM);
$maintainer{$a}= $b;
}
close(MM);
- open(MM,"$gMaintainerFileOverride") or &quit("open $gMaintainerFileOverride: $!");
+ open(MM,"$gMaintainerFileOverride") or &quitcgi("open $gMaintainerFileOverride: $!");
while(<MM>) {
next unless m/^(\S+)\s+(\S.*\S)\s*$/;
($a,$b)=($1,$2);
while(<MM>) {
next unless m/^(\S+)\s+(\S.*\S)\s*$/;
($a,$b)=($1,$2);
my %pkgsrc;
my %pkgcomponent;
my %pkgsrc;
my %pkgcomponent;
- open(MM,"$gPackageSource") or &quit("open $gPackageSource: $!");
+ open(MM,"$gPackageSource") or &quitcgi("open $gPackageSource: $!");
while(<MM>) {
next unless m/^(\S+)\s+(\S+)\s+(\S.*\S)\s*$/;
($a,$b,$c)=($1,$2,$3);
while(<MM>) {
next unless m/^(\S+)\s+(\S+)\s+(\S.*\S)\s*$/;
($a,$b,$c)=($1,$2,$3);
return $_pseudodesc if $_pseudodesc;
my %pseudodesc;
return $_pseudodesc if $_pseudodesc;
my %pseudodesc;
- open(PSEUDO, "< $gPseudoDescFile") or &quit("open $gPseudoDescFile: $!");
+ open(PSEUDO, "< $gPseudoDescFile") or &quitcgi("open $gPseudoDescFile: $!");
while(<PSEUDO>) {
next unless m/^(\S+)\s+(\S.*\S)\s*$/;
$pseudodesc{lc $1} = $2;
while(<PSEUDO>) {
next unless m/^(\S+)\s+(\S.*\S)\s*$/;
$pseudodesc{lc $1} = $2;
-sub getbugdir {
- my ( $bugnum, $ext ) = @_;
- my $archdir = sprintf "%02d", $bugnum % 100;
- foreach ( ( "$gSpoolDir/db-h/$archdir", "$gSpoolDir/db", "$gSpoolDir/archive/$archdir" ) ) {
- return $_ if ( -r "$_/$bugnum.$ext" );
- }
- return undef;
-}
-
sub getbugstatus {
my $bugnum = shift;
my %status;
sub getbugstatus {
my $bugnum = shift;
my %status;
- my $dir = getbugdir( $bugnum, "status" );
- return {} if ( !$dir );
- open S, "< $dir/$bugnum.status";
- my @lines = qw(originator date subject msgid package tags done
- forwarded mergedwith severity);
- while(<S>) {
- chomp;
- $status{shift @lines} = $_;
- }
- close(S);
- $status{shift @lines} = '' while(@lines);
+ my $location = getbuglocation( $bugnum, "status" );
+ return {} if ( !$location );
+ %status = %{ readbug( $bugnum, $location ) };
+
+ $status{tags} = $status{keywords};
$status{"package"} =~ s/\s*$//;
$status{"package"} = 'unknown' if ($status{"package"} eq '');
$status{"package"} =~ s/\s*$//;
$status{"package"} = 'unknown' if ($status{"package"} eq '');
sub buglog {
my $bugnum = shift;
sub buglog {
my $bugnum = shift;
- my $dir = getbugdir( $bugnum, "log" );
+ my $dir = getlocationpath( getbuglocation( $bugnum, "log" ) );
+ my $hash = get_hashname( $bugnum );
- return "$dir/$bugnum.log";
+ return "$dir/$hash/$bugnum.log";
my $indexon = $param{'indexon'} || 'pkg';
if ($indexon !~ m/^(pkg|maint|submitter)$/) {
my $indexon = $param{'indexon'} || 'pkg';
if ($indexon !~ m/^(pkg|maint|submitter)$/) {
- quit("You have to choose something to index on");
+ quitcgi("You have to choose something to index on");
}
my $repeatmerged = ($param{'repeatmerged'} || "yes") eq "yes";
my $archive = ($param{'archive'} || "no") eq "yes";
my $sortby = $param{'sortby'} || 'alpha';
if ($sortby !~ m/^(alpha|count)$/) {
}
my $repeatmerged = ($param{'repeatmerged'} || "yes") eq "yes";
my $archive = ($param{'archive'} || "no") eq "yes";
my $sortby = $param{'sortby'} || 'alpha';
if ($sortby !~ m/^(alpha|count)$/) {
- quit("Don't know how to sort like that");
+ quitcgi("Don't know how to sort like that");
}
#my $include = $param{'include'} || "";
}
#my $include = $param{'include'} || "";
-quit("You have to choose something to select by") if (!$found);
+quitcgi("You have to choose something to select by") if (!$found);
my $Archived = $archive ? " Archived" : "";
my $Archived = $archive ? " Archived" : "";