]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 1999-09-20 05:40:06 by gecko]
authorgecko <>
Mon, 20 Sep 1999 12:40:07 +0000 (04:40 -0800)
committergecko <>
Mon, 20 Sep 1999 12:40:07 +0000 (04:40 -0800)
Changes to make archived bugs accessable.  Changes to depersonalize the
email (ie... from $gProject $gBug Tracking System instead of from
$gMaintainer)

cgi/bugreport.cgi
cgi/common.pl
cgi/pkgreport.cgi [new file with mode: 0755]
debian/tmp.changelog [new file with mode: 0644]
scripts/expire.in
scripts/html-control.in
scripts/mailsummary.in
scripts/process.in
scripts/rebuild.in [new file with mode: 0755]
scripts/service.in

index b4191eaca3486de5cf81ca8e7cbdaf5e332112fc..584f1dbcaab7a8f98613edb20095fd2abd7627fa 100755 (executable)
@@ -6,7 +6,7 @@ use strict;
 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';
@@ -17,7 +17,8 @@ my $tail_html;
 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'; 
@@ -78,9 +79,9 @@ my ($short, $tmaint);
 $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='';
@@ -131,7 +132,7 @@ while(my $line = <L>) {
                                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;
index aaf00ae94aca02adcd0158dfb1adc19cdc75779f..b46f9e2ba1c0e9d1a8d0b90e705322112dced714 100644 (file)
@@ -11,8 +11,9 @@ sub quit {
 
 sub htmlindexentry {
     my $ref = shift;
+       my $archive = shift;
 
-    my %status = getbugstatus($ref);
+    my %status = getbugstatus($ref, $archive );
     my $result = "";
 
     if  ($status{severity} eq 'normal') {
@@ -23,9 +24,9 @@ sub htmlindexentry {
         $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})
@@ -97,7 +98,8 @@ sub bugurl {
     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";
@@ -111,7 +113,7 @@ sub packageurl {
 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$/,
@@ -123,13 +125,23 @@ sub allbugs {
 
 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 {
@@ -149,10 +161,15 @@ 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>) {
@@ -175,7 +192,11 @@ sub getbugstatus {
 
 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
diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi
new file mode 100755 (executable)
index 0000000..5526b7e
--- /dev/null
@@ -0,0 +1,71 @@
+#!/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;
diff --git a/debian/tmp.changelog b/debian/tmp.changelog
new file mode 100644 (file)
index 0000000..3f613db
--- /dev/null
@@ -0,0 +1,25 @@
+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
index 83378c345c4de7604dd6b410dc5158a1f939438e..ab45e5bc59a82e75ac53f2acde040c465ae15dad 100755 (executable)
@@ -1,5 +1,5 @@
 #!/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');
@@ -30,7 +30,7 @@ grep(s/\.status$//,@list);
 
 #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;
@@ -73,6 +73,11 @@ while (length($ref=shift(@list)))
                                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");
index e30b396c66d0eeb8e56752397d3d86033e77e428..beb82d347632d73a87df1b3941257af5bca10a48 100755 (executable)
@@ -1,5 +1,5 @@
 #!/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;
 
@@ -53,7 +53,7 @@ $seqmid= $sequences; $seqmid =~ y/ /-/;
 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>
@@ -63,7 +63,7 @@ END
       ) 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>
index 4cf97b01dbe8c29b22eae1eb58f234deab46baf9..c6e65d9da747ce40a78a51bc5cf507b965f486a2 100755 (executable)
@@ -1,5 +1,5 @@
 #!/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' );
 
@@ -59,7 +59,7 @@ open(D, '| '.join(' ',('/usr/lib/sendmail','-f'.$gMaintainerEmail)).' -odi -oem
     die "start sendmail: $!";
 
 print D <<END || die "complete sendmail";
-From: $gMaintainerEmail ($gMaintainer)
+From: $gMaintainerEmail ($gProject $gBug Tracking System)
 To: $gSummaryList\@$gListDomain
 Subject: $subject
 
index 72cf0c15e8241997248cc09cbb6dcce7450e9bd3..a3249fdb803dd6692e833589501422f3c248319c 100755 (executable)
@@ -1,5 +1,5 @@
 #!/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
@@ -94,7 +94,7 @@ while (defined ($msg[$i] ) )
 {
        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/;
@@ -781,12 +781,23 @@ sub get_addresses {
 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';
diff --git a/scripts/rebuild.in b/scripts/rebuild.in
new file mode 100755 (executable)
index 0000000..88e71a1
--- /dev/null
@@ -0,0 +1,55 @@
+#!/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;
index bce816f0d5bca692432c77dc8bd0e212d0149442..9aae39be56c9629065048e65927d1447f83a0de2 100755 (executable)
@@ -1,5 +1,5 @@
 #!/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
@@ -229,7 +229,7 @@ END
                                        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)
@@ -455,7 +455,7 @@ if (@maintccs) {
 } 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'}
@@ -742,7 +742,7 @@ sub sendtxthelpraw {
     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'}
@@ -768,7 +768,7 @@ sub sendlynxdocraw {
     } 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'}