use CGI qw/:standard/;
require '/usr/lib/debbugs/errorlib';
-require '/debian/home/ajt/ajbug/common.pl';
+require '/usr/lib/debbugs/common.pl';
require '/etc/debbugs/config';
require '/etc/debbugs/text';
my %maintainer = getmaintainers();
my $ref= param('bug') || die("No bug number");
-my %status = getbugstatus($ref);
+my $archive = (param('archive') || 'no') eq 'yes';
+my %status = getbugstatus($ref, $archive);
my $msg = param('msg') || "";
my $boring = (param('boring') || 'no') eq 'yes';
$short = $ref; $short =~ s/^\d+/#$&/;
$tmaint = defined($maintainer{$tpack}) ? $maintainer{$tpack} : '(unknown)';
$descriptivehead= $indexentry.$submitted.";\nMaintainer for $status{package} is\n".
- '<A href="../ma/l'.&maintencoded($tmaint).'.html">'.&sani($tmaint).'</A>.';
+ '<A href="http://'.$debbugs::gWebDomain.'/ma/l'.&maintencoded($tmaint).'.html">'.&sani($tmaint).'</A>.';
-my $buglog = buglog($ref);
+my $buglog = buglog($ref, $archive);
open L, "<$buglog" || &quit("open log for $ref: $!");
my $log='';
if $normstate eq 'go' || $normstate eq 'go-nox';
if ($normstate eq 'html') {
- $this .= " <em><A href=\"" . bugurl($ref,"msg=$xmessage") . "\">Full text</A> available.</em>";
+ $this .= " <em><A href=\"" . bugurl($ref, "msg=$xmessage", "archive=$archive") . "\">Full text</A> available.</em>";
}
my $show = 1;
sub htmlindexentry {
my $ref = shift;
+ my $archive = shift;
- my %status = getbugstatus($ref);
+ my %status = getbugstatus($ref, $archive );
my $result = "";
if ($status{severity} eq 'normal') {
$showseverity = "Severity: <em>$status{severity}</em>;\n";
}
- $result .= "Package: <a href=\"" . pkgurl($status{package}) . "\"><strong>"
- . htmlsanit($status{package}) . "</strong></a>;\n"
- if (length($status{package}));
+ $result .= "Package: <a href=\"" . pkgurl($status{"package"}) . "\"><strong>"
+ . htmlsanit($status{"package"}) . "</strong></a>;\n"
+ if (length($status{"package"}));
$result .= $showseverity;
$result .= "Reported by: " . htmlsanit($status{originator});
$result .= ";\nKeywords: " . htmlsanit($status{keywords})
my $ref = shift;
my $params = "bug=$ref";
foreach my $val (@_) {
- $params .= "\&msg=$1" if ($val =~ /^msg=([0-9]+)$/);
+ $params .= "\&msg=$1" if ($val =~ /^msg=([0-9]+)/);
+ $params .= "\&archive=yes" if ($val =~ /^archive=1/);
}
return $debbugs::gCGIDomain . "bugreport.cgi" . "?" . "$params";
sub allbugs {
my @bugs = ();
- opendir(D, $debbugs::gSpoolDir/db) || &quit("opendir db: $!");
+ opendir(D, "$debbugs::gSpoolDir/db") || &quit("opendir db: $!");
@bugs = sort { $a <=> $b }
grep s/\.status$//,
(grep m/^[0-9]+\.status$/,
sub pkgbugs {
my $pkg = shift;
- my @bugs = ();
- open I, "<$gAJIndex" || &quit("bugindex: $!");
- while(<I>) {
- push @bugs, $1 if (/^([0-9]+) $pkg$/);
+ open I, "<$debbugs::gSpoolDir/archive/index" || &quit("bugindex: $!");
+ while(<I>)
+ { if (/^$pkg\s+(\d+)\s+(.+)/)
+ {
+ my $tmpstr = sprintf( "%d: %s", $1, $2 );
+ $descstr{ $1 } = $tmpstr;
+ }
}
- @bugs = sort { $a <=> $b } @bugs;
- return @bugs;
+ return %descstr;
+}
+
+sub pkgbugsindex {
+ my $pkg = shift;
+ my @bugs = ();
+ open I, "<$debbugs::gSpoolDir/archive/index" || &quit("bugindex: $!");
+ while(<I>) { $descstr{ $1 } = 1 if (/^(\S+)/); }
+ return %descstr;
}
sub getmaintainers {
sub getbugstatus {
my $bugnum = shift;
+ my $archive = shift;
my %status;
- open(S,"$gSpoolDir/db/$bugnum.status") || &quit("open $bugnum.status: $!");
+ if ( $archive )
+ { my $archdir = $bugnum % 100;
+ open(S,"$gSpoolDir/archive/$archdir/$bugnum.status" ) || &quit("open $bugnum.status: $!");
+ } else
+ { open(S,"$gSpoolDir/db/$bugnum.status") || &quit("open $bugnum.status: $!"); }
my @lines = qw(originator date subject msgid package keywords done
forwarded mergedwith severity);
while(<S>) {
sub buglog {
my $bugnum = shift;
- return "$gSpoolDir/db/$bugnum.log";
+ my $archive = shift;
+ if ( $archive )
+ { my $archdir = $bugnum % 100;
+ return "$gSpoolDir/archive/$archdir/$bugnum.log";
+ } else { return "$gSpoolDir/db/$bugnum.log"; }
}
1
--- /dev/null
+#!/usr/bin/perl -w
+
+package debbugs;
+
+use strict;
+use CGI qw/:standard/;
+
+require '/usr/lib/debbugs/errorlib';
+require '/usr/lib/debbugs/common.pl';
+
+require '/etc/debbugs/config';
+require '/etc/debbugs/text';
+
+my $pkg = param('pkg');
+
+$pkg = 'ALL' unless defined( $pkg );
+
+my $repeatmerged = (param('repeatmerged') || 'yes') eq 'yes';
+my $this = "";
+
+my %indexentry;
+my %maintainer = ();
+my %strings = ();
+
+my %displayshowpending = ('pending','outstanding',
+ 'done','resolved',
+ 'forwarded','forwarded to upstream software authors');
+
+my $dtime=`date -u '+%H:%M:%S GMT %a %d %h'`;
+chomp($dtime);
+my $tail_html = $debbugs::gHTMLTail;
+$tail_html =~ s/SUBSTITUTE_DTIME/$dtime/;
+
+
+print header;
+print start_html("$debbugs::gProject Archived $debbugs::gBug report logs: package $pkg");
+print h1("$debbugs::gProject Archived $debbugs::gBug report logs: package $pkg");
+
+#if (defined $maintainer{$pkg}) {
+# print "<p>Maintainer for $pkg is <a href=\""
+# . mainturl($maintainer{$pkg}) . "\">"
+# . htmlsanit($maintainer{$pkg}) . "</a>.</p>\n";
+#}
+
+print "<p>Note that with multi-binary packages there may be other reports\n";
+print "filed under the different binary package names.</p>\n";
+
+if ( $pkg ne 'ALL' )
+{ %strings = pkgbugs($pkg);
+ foreach my $bug ( keys %strings )
+ { $this .= " <LI><A href=\"" . bugurl($bug, "archive=1") . "\">". $strings{ $bug } ."\n"; }
+} else
+{ %strings = pkgbugsindex();
+ my @bugs = ();
+ foreach my $bug ( keys %strings ) { push @bugs, $bug; }
+ @bugs = sort { $a cmp $b } @bugs;
+ foreach my $bug ( @bugs )
+ { $this .= " <LI><A HREF=\"http://cgi.debian.org/cgi-bin/pkgarch.cgi?pkg=". $bug ."\">". $bug . "\n"; }
+}
+
+if ( length( $this ) )
+{ print "<UL>\n";
+ print $this;
+ print "</UL>\n";
+} else
+{ print "No archived reports found\n"; }
+
+print hr;
+print "$tail_html";
+
+print end_html;
--- /dev/null
+This file is to document changes I've made until I change the version in
+the changelog file.
+
+* Fixed X-Project-CC header to specify additional addresses to send bug
+ info to. The header has been changed to X-Project-CC to make it
+ generic, too.
+
+* Cleaned service and processall scripts to be -w clean.
+
+* Added a column to the ./db/ix/summary.html that gives an indication of
+ the severity of the bug -- if set. For the moment, if the severity has
+ been set to "normal" we'll see "n". If severity wasn't set, there'd be
+ no letter. We might want to make "blank" to "n" or "n" to blank
+
+* Removed the case in package names so that netscap4 and Netscape4 are
+ the same package.
+
+* Added option archiving of bugs (move instead of remove). When
+ archived, the bugs will be left in /var/lib/debbugs/spool/archive.
+ Added the necessary CGI scripts to access the archived bugs.
+
+* Changed the message sent back to the developer (and to the
+ debian-bugs-closed list) to include the message used to close the bug.
+
+* Changed scripts to ignore mime and clearsigned pgp/gpg signed messages
#!/usr/bin/perl
-# $Id: expire.in,v 1.4 1999/09/16 07:16:47 gecko Exp $
+# $Id: expire.in,v 1.5 1999/09/20 05:40:07 gecko Exp $
# Load modules and set envirnment
require('/etc/debbugs/config');
#process each bug (ie, status file)
while (length($ref=shift(@list)))
-{ print STDERR "$ref $considering\n" if $debug;
+{ print STDERR "$ref considering\n" if $debug;
$bfound= &lockreadbugmerge($ref);
print STDERR "$ref read $bfound\n" if $debug;
$bfound || next;
copy( "db/$mref.log", "$dir/$mref.log" );
copy( "db/$mref.status", "$dir/$mref.status" );
copy( "db/$mref.report", "$dir/$mref.report" );
+ if ( open( IDXFILE, ">>archive/index" ) )
+ { printf IDXFILE "%s %d %s\n", $s_package, $mref, $s_subject;
+ close IDXFILE;
+ } else { print "Unable to write to index file\n"; }
+
print("archived $mref to $dir (from $ref)\n") || &quit("output old: $!");
}
unlink("db/$mref.log", "db/$mref.status", "db/$mref.report");
#!/usr/bin/perl
-# $Id: html-control.in,v 1.2 1999/09/02 22:27:29 gecko Exp $
+# $Id: html-control.in,v 1.3 1999/09/20 05:40:07 gecko Exp $
use POSIX;
open(MM,">html-data.mail") or nonawful("open html-data.mail: $!");
if ( length( $gListDomain ) > 0 && length( $gMirrorList ) > 0 ) {
print(MM <<END
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $gMirrorList\@$gListDomain
Subject: $gProject $gBugs autoupdate 259012
Message-ID: <handle.htmlup.$seqmid\@gEmailDebian>
) or nonawful("write html-data.mail header: $!");
} else {
print(MM <<END
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $gMaintainerEmail
Subject: $gProject $gBugs autoupdate 259012
Message-ID: <handle.htmlup.$seqmid\@gEmailDebian>
#!/usr/bin/perl
-# $Id: mailsummary.in,v 1.3 1999/09/14 22:33:48 gecko Exp $
+# $Id: mailsummary.in,v 1.4 1999/09/20 05:40:07 gecko Exp $
require( '/etc/debbugs/config' );
die "start sendmail: $!";
print D <<END || die "complete sendmail";
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $gSummaryList\@$gListDomain
Subject: $subject
#!/usr/bin/perl
-# $Id: process.in,v 1.7 1999/09/18 21:01:27 gecko Exp $
+# $Id: process.in,v 1.8 1999/09/20 05:40:07 gecko Exp $
#
# Usage: process nn
# Temps: incoming/Pnn
{
last if ( $msg[$i] !~ m/^([\w]+):\s*(\S+)/ );
$i++;
- $fn = $1; $fv $2;
+ $fn = $1; $fv = $2;
print DEBUG ">$fn|$'|\n";
$fwd .= $fn.': '.$fv."\n";
$fn =~ y/A-Z/a-z/;
sub sendmessage {
local ($msg,@recips) = @_;
if ($recips[0] eq '' && $#recips == 0) { @recips= ('-t'); }
+
+ #save email to the log
open(AP,">>db/$ref.log") || &quit("opening db/$ref.log (lo): $!");
print(AP "\2\n",join("\4",@recips),"\n\5\n$msg\n\3\n") ||
&quit("writing db/$ref.log (lo): $!");
close(AP) || &quit("closing db/$ref.log (lo): $!");
- print DEBUG "mailing to >",join('|',@recips),"<\n";
+ #if debbuging.. save email to a log
+# open AP, ">>debug";
+# print AP join( '|', @recips )."\n>>";
+# print AP get_addresses( @recips );
+# print AP "<<\n".$msg;
+# print AP "\n--------------------------------------------------------\n";
+# close AP;
+
+ #start mailing
+ $msg =~ /^Subject: (.*)$/;
$SIG{'CHLD'}='chldhandle';
#print DEBUG "mailing sigchild set up<\n";
$chldexit = 'no';
--- /dev/null
+#!/usr/bin/perl -w
+# $Id: rebuild.in,v 1.1 1999/09/20 05:40:07 gecko Exp $
+
+# Load modules and set envirnment
+use File::Copy;
+require('/etc/debbugs/config');
+require('/usr/lib/debbugs/errorlib');
+$ENV{'PATH'}= '/usr/lib/debbugs'.$ENV{'PATH'};
+chdir("$gSpoolDir") || die "chdir spool: $!\n";
+
+sub readreport {
+ my $lref = shift;
+ my $path = shift;
+
+ open(S,"$path/$lref.status") || die "unable to open $path/$lref: $!\n";
+ chop($s_originator= <S>);
+ chop($s_date= <S>);
+ chop($s_subject= <S>);
+ chop($s_msgid= <S>);
+ chop($s_package= <S>);
+ chop($s_keywords= <S>);
+ chop($s_done= <S>);
+ chop($s_forwarded= <S>);
+ chop($s_mergedwith= <S>);
+ chop($s_severity= <S>);
+ close(S);
+ return 1;
+}
+
+#global variables
+$debug = 0;
+defined($startdate= time) || &quit("failed to get time: $!");
+
+open IDXFILE, ">archive/index" or &quit( "trying to reset index file: $!" );
+
+#get list of bugs (ie, status files)
+for ($subdir=0; $subdir<100; $subdir++ )
+{
+ my $path = sprintf( "archive/%.2d", $subdir );
+ opendir(DIR,$path) || next;
+ @list= grep(m/^\d+\.status$/,readdir(DIR));
+ closedir DIR;
+ grep(s/\.status$//,@list);
+ @list= sort { $a <=> $b } @list;
+
+ #process each bug (ie, status file)
+ while ( defined( $list[0] ))
+ { my $ref = shift @list;
+ print STDERR "$ref considering\n" if $debug;
+ readreport($ref, $path);
+ printf IDXFILE "%s %d %s\n", $s_package, $ref, $s_subject;
+ }
+}
+
+close IDXFILE;
#!/usr/bin/perl -w
-# $Id: service.in,v 1.7 1999/09/18 21:01:27 gecko Exp $
+# $Id: service.in,v 1.8 1999/09/20 05:40:07 gecko Exp $
#
# Usage: service <code>.nn
# Temps: incoming/P<code>.nn
0 ) { &addccaddress("$gDoneList\@$gListDomain"); }
$s_done= $replyto;
$message= <<END;
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $s_originator
Subject: $gBug#$ref acknowledged by developer
($s_subject)
} else { $maintccs = ""; }
$reply= <<END;
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $replyto
${maintccs}Subject: Processed: $header{'subject'}
In-Reply-To: $header{'message-id'}
close(D);
&transcript("Sending $description in separate message.\n");
&sendmailmessage(<<END.$doc,$replyto);
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $replyto
Subject: $gProject $gBug help: $description
References: $header{'message-id'}
} else {
&transcript("Sending $description.\n");
&sendmailmessage(<<END.$doc,$replyto);
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
To: $replyto
Subject: $gProject $gBugs information: $description
References: $header{'message-id'}