elsif ($ARGV[0] =~ m/^-lastrun\=([0-9.]+)$/) { $lastrun= $1; undef $stampfile; }
elsif ($ARGV[0] =~ m/^-full$/) { undef $lastrun; undef $stampfile; }
elsif ($ARGV[0] =~ m/^-stampfile\=(\S+)$/) { $stampfile= $1; }
- else { &quit("bad usage"); }
+ else { die "bad usage"; }
shift;
}
$wwwbase= shift(@ARGV);
#get starting time
-defined($startdate= time) || &quit("failed to get time: $!");
+defined($startdate= time) || die "failed to get time: $!";
$|=1;
}
#parse maintainer file
-open(MM,"$gMaintainerFile") || &quit("open $gMaintainerFile: $!");
+open(MM,"$gMaintainerFile") || die "open $gMaintainerFile: $!";
while(<MM>)
-{ m/^(\S+)\s+(\S.*\S)\s*$/ || &quit("$gMaintainerFile: \`$_'");
+{ m/^(\S+)\s+(\S.*\S)\s*$/ || die "$gMaintainerFile: \`$_'";
($a,$b)=($1,$2);
$a =~ y/A-Z/a-z/;
$maintainer{$a}= $b;
close(MM);
#load all database files
-opendir(D,'db-h') || &quit("opendir db-h: $!");
+opendir(D,'db-h') || die "opendir db-h: $!";
@dirs = grep(s#^#db-h/#,grep(/^\d+$/,readdir(D)));
closedir(D);
foreach my $dir (@dirs) {
for $pending (qw(pending done forwarded))
{ for $severity (@showseverities)
{ eval "\$index${pending}${severity}= \$iiindex${pending}${severity}= ''; 1;"
- or &quit("reset \$index${pending}${severity}: $@");
+ or die "reset \$index${pending}${severity}: $@";
}
}
$indexadd .= "<!--/iid-->" if defined($iiref);
$indexadd .= "\n";
$estr= "\$index$indexpart = \$indexadd.\$index$indexpart; 1;";
- eval($estr) || &quit("eval add to \$index$indexpart ($estr) failed: $@");
+ eval($estr) || die "eval add to \$index$indexpart ($estr) failed: $@";
#print STDERR ">$estr|$indexadd<\n";
$indexadd= "<!--ii $iiref-->\n" if defined($iiref);
eval("\$iiindex$indexpart = \$indexadd.\$iiindex$indexpart; 1;") ||
- &quit("eval add to \$iiindex$indexpart failed: $@");
+ die "eval add to \$iiindex$indexpart failed: $@";
if (defined($tmaint))
{ $countpermaint{$tmaint} += length($data->{done}) ? 0 : length($data->{forwarded}) ? 0 : 1;
eval("\$permaint${indexpart}{\$tmaint} .= \$indexadd; 1;") ||
- &quit("eval add to \$permaint${indexpart}{\$tmaint} failed: $@");
+ die "eval add to \$permaint${indexpart}{\$tmaint} failed: $@";
}
if (defined($tpack))
{ $countperpack{$tpack} += length($data->{done}) ? 0 : length($data->{forwarded}) ? 0 : 1;
eval("\$perpack${indexpart}{\$tpack} .= \$indexadd; 1;") ||
- &quit("eval add to \$perpack${indexpart}{\$tpack} failed: $@");
+ die "eval add to \$perpack${indexpart}{\$tpack} failed: $@";
}
if ($preserveonly) { &preserve("$linkto.html"); &preserve("$linkto-b.html"); &unfilelock; next; }
my $hash = get_hashname($ref);
- open(L,"db-h/$hash/$ref.log") || &quit("open db-h/$hash/$ref.log: $!");
+ open(L,"db-h/$hash/$ref.log") || die "open db-h/$hash/$ref.log: $!";
$log='';
$boring=''; $xmessage= 0;
$normstate= 'kill-init';
while(<L>) {
if (m/^\07$/) {
$normstate eq 'kill-init' || $normstate eq 'kill-end' ||
- &quit("$ref ^G in state $normstate");
+ die "$ref ^G in state $normstate";
$normstate= 'incoming-recv';
} elsif (m/^\01$/) {
$normstate eq 'kill-init' || $normstate eq 'kill-end' ||
- &quit("$ref ^A in state $normstate");
+ die "$ref ^A in state $normstate";
$normstate= 'autocheck';
} elsif (m/^\02$/) {
$normstate eq 'kill-init' || $normstate eq 'kill-end' ||
- &quit("$ref ^B in state $normstate");
+ die "$ref ^B in state $normstate";
$normstate= 'recips';
} elsif (m/^\03$/) {
$normstate eq 'go' || $normstate eq 'go-nox' || $normstate eq 'html' ||
- &quit("$ref ^C in state $normstate");
+ die "$ref ^C in state $normstate";
$this .= "</pre>\n" if $normstate eq 'go' || $normstate eq 'go-nox';
if ($normstate eq 'html') {
$xmessage++;
$suppressnext= $normstate eq 'html';
$normstate= 'kill-end';
} elsif (m/^\05$/) {
- $normstate eq 'kill-body' || &quit("^E in state $normstate");
+ $normstate eq 'kill-body' || die "^E in state $normstate";
$this .= "<pre>\n";
$normstate= 'go';
} elsif (m/^\06$/) {
$normstate eq 'kill-init' || $normstate eq 'kill-end' ||
- &quit("$ref ^F in state $normstate");
+ die "$ref ^F in state $normstate";
$normstate= 'html'; $this= '';
} elsif ($normstate eq 'incoming-recv') {
$pl= $_; $pl =~ s/\n+$//;
m/^Received: \(at (\S+)\) by (\S+)\;/ ||
- &quit("bad line \`$pl' in state incoming-recv");
+ die "bad line \`$pl' in state incoming-recv";
$this = "<h2>Message received at ".&sani("$1\@$2").":</h2><br>\n".
"<pre>\n".
"$_";
$normstate= 'go-nox';
$this .= "<pre>\n";
} else {
- &quit("$ref state $normstate line \`$_'");
+ die "$ref state $normstate line \`$_'";
}
}
- &quit("$ref state $normstate at end") unless $normstate eq 'kill-end';
+ die "$ref state $normstate at end" unless $normstate eq 'kill-end';
close(L);
if (length($boring)) {
&file("$linkto-b.html",'non',
$estr= "\$value= \\${varprefix}${pending}${severity}${varsuffix}; 1;";
#print STDERR $estr;
eval $estr
- or &quit("eval get \$${varprefix}${pending}${severity} failed: $@");
+ or die "eval get \$${varprefix}${pending}${severity} failed: $@";
#print STDERR ">$$value<\n";
next unless length($$value);
$text.= "<hr>\n<h2>".&heading($pending,$severity).":</h2>\n".
for $pending (qw(pending forwarded done)) {
for $severity (@showseverities) {
eval "\$value= \\\$iiindex${pending}${severity}; 1;"
- or &quit("eval get \$iiindex${pendingtype}${severity} failed: $@");
+ or die "eval get \$iiindex${pendingtype}${severity} failed: $@";
$value= \$nobugs_html if !length($$value);
$headstring= &heading($pending,$severity);
&file("si/$pending$severity.html",'ref',
$tail_html."</body></html>\n");
open(P,"$gPseudoDescFile") ||
- &quit("$gPseudoDescFile: $!");
+ die "$gPseudoDescFile: $!";
$ppd=''; while(<P>) { s/\s*\n$//; $ppd.= &sani($_)."\n"; } close(P);
&file('ix/pseudopackages.html','non',
$gPseudoIndex.
print "preserve $name\n";
return;
}
- defined($c= open(P,"-|")) or &quit("pipe/fork for diff: $!");
+ defined($c= open(P,"-|")) or die "pipe/fork for diff: $!";
if (!$c) {
open(Q,"|diff -e $cmppath -") or die "pipe/fork II for diff: $!\n";
print Q $file or die "write orig to diff: $!\n";
}
$v= (split(/\n/,$difftxt));
print "diff $v $ii $name\n${difftxt}thatdiff $name\n"
- or &quit("stdout (diff): $!");
+ or die "stdout (diff): $!";
return;
}
}
$v= (split(/\n/,$file));
- print "file $v $ii $name\n${file}thatfile $name\n" or &quit("stdout: $!");
+ print "file $v $ii $name\n${file}thatfile $name\n" or die "stdout: $!";
}
sub preserve {
&filelock("html.fcntl-lock");
-unlink("html-data.gz") || $!==&ENOENT or &quit("remove html-data.gz: $!");
+unlink("html-data.gz") || $!==&ENOENT or die "remove html-data.gz: $!";
sub nonawful ($) {
rename("stamp.html.run","stamp.html") or warn "warning: put back stamp.html: $!";
- &quit($_[0]);
+ die $_[0];
}
if (open(US,'updateseqs') && -f 'stamp.html') {
$lastsub++;
$args= "-diff -stampfile=stamp.html.run";
- rename("stamp.html","stamp.html.run") or &quit("rename stamp.html: $!");
+ rename("stamp.html","stamp.html.run") or die "rename stamp.html: $!";
} else {
$lastsub=0;
$lastmain = strftime "%Y%m%d%H%M%S", localtime;
$args= '-full';
- unlink('stamp.html') || $!==&ENOENT or &quit("excise stale stamp.html: $!");
+ unlink('stamp.html') || $!==&ENOENT or die "excise stale stamp.html: $!";
}
-open(X,">stamp.html.new") or &quit("stamp.html.new: $!");
-close(X) or &quit("close stamp.html.new: $!");
+open(X,">stamp.html.new") or die "stamp.html.new: $!";
+close(X) or die "close stamp.html.new: $!";
-open(US,'>updateseqs.new') || &quit("create updateseqs.new: $!");
-print(US "$lastmain\n$lastsub\n") || &quit("write updateseqs.new: $!");
-close(US) || &quit("close updateseqs.new: $!");
+open(US,'>updateseqs.new') || die "create updateseqs.new: $!";
+print(US "$lastmain\n$lastsub\n") || die "write updateseqs.new: $!";
+close(US) || die "close updateseqs.new: $!";
rename('updateseqs.new','updateseqs') or nonawful("install updateseqs: $!");
sub runshell ($&) {
#runshell('2>&1 '.join(' ',('/usr/lib/sendmail','-f'."$gMaintainerEmail")).' -oem -oi -t <html-data.mail',
# sub { &quit; });
-rename("stamp.html.new","stamp.html") or &quit("install new stamp.html: $!");
+rename("stamp.html.new","stamp.html") or die "install new stamp.html: $!";
unlink("html-data") or warn "remove html-data: $!";
#unlink("html-data.gz") or warn "remove html-data.gz: $!";
umask(002);
open DEBUG, ">/dev/null";
-my $intdate = time or quit("failed to get time: $!");
+my $intdate = time or die "failed to get time: $!";
$_=shift;
-m/^([BMQFDUL])(\d*)\.\d+$/ or quit("bad argument: $_");
+m/^([BMQFDUL])(\d*)\.\d+$/ or die "bad argument: $_";
my $codeletter= $1;
my $tryref= length($2) ? $2 : -1;
my $nn= $_;
if (!rename("incoming/G$nn","incoming/P$nn"))
{
$_=$!.''; m/no such file or directory/i && exit 0;
- &quit("renaming to lock: $!");
+ die "renaming to lock: $!";
}
my $baddress= 'submit' if $codeletter eq 'B';
$baddress= 'done' if $codeletter eq 'D';
$baddress= 'submitter' if $codeletter eq 'U';
bug_list_forward($nn) if $codeletter eq 'L';
-$baddress || &quit("bad codeletter $codeletter");
+$baddress || die "bad codeletter $codeletter";
my $baddressroot= $baddress;
$baddress= "$tryref-$baddress" if $tryref>=0;
if (defined $header{'resent-from'} && !defined $header{'from'}) {
$header{'from'} = $header{'resent-from'};
}
-defined($header{'from'}) || &quit("no From header");
+defined($header{'from'}) || die "no From header";
my $replyto = $header{'reply-to'};
$replyto = '' unless defined $replyto;
writebug($ref, $data);
my $hash = get_hashname($ref);
- open(O,"db-h/$hash/$ref.report") || &quit("read original report: $!");
+ open(O,"db-h/$hash/$ref.report") || die "read original report: $!";
my $orig_report= join('',<O>); close(O);
if ($codeletter eq 'F') {
&htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
$data->{'forwarded-to'} = $pheader{forwarded};
}
&filelock("nextnumber.lock");
- open(N,"nextnumber") || &quit("nextnumber: read: $!");
- my $nextnumber=<N>; $nextnumber =~ s/\n$// || &quit("nextnumber bad format");
+ open(N,"nextnumber") || die "nextnumber: read: $!";
+ my $nextnumber=<N>; $nextnumber =~ s/\n$// || die "nextnumber bad format";
$ref= $nextnumber+0; $nextnumber += 1; $newref=1;
&overwrite('nextnumber', "$nextnumber\n");
&unfilelock;
sub overwrite {
my ($f,$v) = @_;
- open(NEW,">$f.new") || &quit("$f.new: create: $!");
- print(NEW "$v") || &quit("$f.new: write: $!");
- close(NEW) || &quit("$f.new: close: $!");
- rename("$f.new","$f") || &quit("rename $f.new to $f: $!");
+ open(NEW,">$f.new") || die "$f.new: create: $!";
+ print(NEW "$v") || die "$f.new: write: $!";
+ close(NEW) || die "$f.new: close: $!";
+ rename("$f.new","$f") || die "rename $f.new to $f: $!";
}
sub appendlog {
if (!open(AP,">>db-h/$hash/$ref.log")) {
print DEBUG "failed open log<\n";
print DEBUG "failed open log err $!<\n";
- &quit("opening db-h/$hash/$ref.log (li): $!");
+ die "opening db-h/$hash/$ref.log (li): $!";
}
- print(AP "\7\n",escape_log(@log),"\n\3\n") || &quit("writing db-h/$hash/$ref.log (li): $!");
- close(AP) || &quit("closing db-h/$hash/$ref.log (li): $!");
+ print(AP "\7\n",escape_log(@log),"\n\3\n") || die "writing db-h/$hash/$ref.log (li): $!";
+ close(AP) || die "closing db-h/$hash/$ref.log (li): $!";
}
sub finish {
# cleanups are run in an end block now.
#my ($u);
#while ($u= $cleanups[$#cleanups]) { &$u; }
- unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
+ unlink("incoming/P$nn") || die "unlinking incoming/P$nn: $!";
exit $exit;
}
-&quit("wot no exit");
+die "wot no exit";
sub htmllog {
my ($whatobj,$whatverb,$where,$desc) = @_;
my $hash = get_hashname($ref);
- open(AP,">>db-h/$hash/$ref.log") || &quit("opening db-h/$hash/$ref.log (lh): $!");
+ open(AP,">>db-h/$hash/$ref.log") || die "opening db-h/$hash/$ref.log (lh): $!";
print(AP
"\6\n".
"<strong>$whatobj $whatverb</strong>".
($where eq '' ? "" : " to <code>".html_escape($where)."</code>").
":<br>\n". $desc.
- "\n\3\n") || &quit("writing db-h/$hash/$ref.log (lh): $!");
- close(AP) || &quit("closing db-h/$hash/$ref.log (lh): $!");
+ "\n\3\n") || die "writing db-h/$hash/$ref.log (lh): $!";
+ close(AP) || die "closing db-h/$hash/$ref.log (lh): $!";
}
sub stripbccs {
my $hash = get_hashname($ref);
#save email to the log
- open(AP,">>db-h/$hash/$ref.log") || &quit("opening db-h/$hash/$ref.log (lo): $!");
+ open(AP,">>db-h/$hash/$ref.log") || die "opening db-h/$hash/$ref.log (lo): $!";
print(AP "\2\n",join("\4",@$recips),"\n\5\n",
escape_log(stripbccs($msg)),"\n\3\n") ||
- &quit("writing db-h/$hash/$ref.log (lo): $!");
- close(AP) || &quit("closing db-h/$hash/$ref.log (lo): $!");
+ die "writing db-h/$hash/$ref.log (lo): $!";
+ close(AP) || die "closing db-h/$hash/$ref.log (lo): $!";
if (ref($bcc)) {
shift @$recips if $recips->[0] eq '-t';
return if $maintainerschecked++;
return if !length($data->{package});
my %maintainerof;
- open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
+ open(MAINT,"$gMaintainerFile") || die die "maintainers open: $!";
while (<MAINT>) {
m/^\n$/ && next;
m/^\s*$/ && next;
- m/^(\S+)\s+(\S.*\S)\s*\n$/ || &quit("maintainers bogus \`$_'");
+ m/^(\S+)\s+(\S.*\S)\s*\n$/ || die "maintainers bogus \`$_'";
$a= $1; $b= $2; $a =~ y/A-Z/a-z/;
# use the package which is normalized to lower case; we do this because we lc the pseudo headers.
$maintainerof{$a}= $2;
}
close(MAINT);
- open(MAINT,"$gMaintainerFileOverride") || die &quit("maintainers.override open: $!");
+ open(MAINT,"$gMaintainerFileOverride") || die die "maintainers.override open: $!";
while (<MAINT>) {
m/^\n$/ && next;
m/^\s*$/ && next;
- m/^(\S+)\s+(\S.*\S)\s*\n$/ || &quit("maintainers.override bogus \`$_'");
+ m/^(\S+)\s+(\S.*\S)\s*\n$/ || die "maintainers.override bogus \`$_'";
$a= $1; $b= $2; $a =~ y/A-Z/a-z/;
# use the package which is normalized to lower case; we do this because we lc the pseudo headers.
$maintainerof{$a}= $2;
}
close(MAINT);
my %pkgsrc;
- open(SOURCES,"$gPackageSource") || &quit("pkgsrc open: $!");
+ open(SOURCES,"$gPackageSource") || die "pkgsrc open: $!";
while (<SOURCES>) {
next unless m/^(\S+)\s+\S+\s+(\S.*\S)\s*$/;
($a,$b)=($1,$2);
envelope_from => $envelope_from,
encode_headers => 0,
);
- unlink("incoming/P$bug_fn") || &quit("unlinking incoming/P$bug_fn: $!");
+ unlink("incoming/P$bug_fn") || die "unlinking incoming/P$bug_fn: $!";
exit 0;
}
#global variables
$debug = 0;
-@ARGV==0 and &quit( "no archive given on the commandline" );
+@ARGV==0 and die "no archive given on the commandline" ;
my $archive = shift(@ARGV);
my $index = "index.$archive";
$index = 'index.db' if $archive eq 'db-h';
-open IDXFILE, "> $index" or &quit( "trying to reset index file: $!" );
+open IDXFILE, "> $index" or die "trying to reset index file: $!" ;
#get list of bugs (ie, status files)
my @files;
$mode= shift(@ARGV);
-open(M,"$gMaintainerFile") || &quit("open $gMaintainerFile: $!");
+open(M,"$gMaintainerFile") || die "open $gMaintainerFile: $!";
while (<M>) {
m/^(\S+)\s+(\S.*\S)\s*$/ || warn "$_ ?";
($a,$b)=($1,$2);
$maintainer{$a}= $b;
}
close(M);
-open(M,"$gMaintainerFileOverride") || &quit("open $gMaintainerFileOverride: $!");
+open(M,"$gMaintainerFileOverride") || die "open $gMaintainerFileOverride: $!";
while (<M>) {
m/^(\S+)\s+(\S.*\S)\s*$/ || warn "$_ ?";
($a,$b)=($1,$2);
close(M);
-defined($startdate= time) || &quit("failed to get time: $!");
+defined($startdate= time) || die "failed to get time: $!";
-opendir(DIR,"db-h") || &quit("opendir db-h: $!\n");
+opendir(DIR,"db-h") || die "opendir db-h: $!\n";
@dirs = grep(s,^,db-h/,, grep(m/^\d+$/,readdir(DIR)));
closedir(DIR);
foreach my $dir (@dirs) {
}
printf("%6d %-10.10s %-30.30s %-.31s\n", $f, $data->{package},
(length($data->{keywords}) ? $data->{keywords}.'/' : '').$data->{subject},
- $data->{maintainer}) || &quit("output undone: $!");
+ $data->{maintainer}) || die "output undone: $!";
} elsif ($mode eq 'bymaint') {
&unfilelock;
next if length($data->{done}) || length($data->{forwarded});
$maintainercnt{$data->{maintainer}}++;
$maintainerlist{$data->{maintainer}}.= " $f";
} else {
- &quit("badmode $mode");
+ die "badmode $mode";
}
}
if ($mode eq 'bymaint') {
- print("$head\n") || &quit("output head: $!");
+ print("$head\n") || die "output head: $!";
for $m (sort { $maintainercnt{$a} <=> $maintainercnt{$b} } keys %maintainercnt) {
printf("\n%s (%d $gBugs):\n",$m,$maintainercnt{$m})
- || &quit("output mainthead: $!");
+ || die "output mainthead: $!";
for $i (sort { $string{$a} cmp $string{$b} } split(/ /,$maintainerlist{$m})) {
- printf($string{$i}) || &quit("output 1bymaint: $!");
+ printf($string{$i}) || die "output 1bymaint: $!";
}
}
}
-close(STDOUT) || &quit("close stdout: $!");
+close(STDOUT) || die "close stdout: $!";