]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 1999-10-25 06:18:13 by gecko]
authorgecko <>
Mon, 25 Oct 1999 13:18:14 +0000 (05:18 -0800)
committergecko <>
Mon, 25 Oct 1999 13:18:14 +0000 (05:18 -0800)
A few bugs fixes in the *report.cgi scripts

cgi/bugreport.cgi
cgi/common.pl
cgi/pkgreport.cgi
debian/changelog
scripts/rebuild.in

index 584f1dbcaab7a8f98613edb20095fd2abd7627fa..647011f9ff72d44034dcfa2d5f1a16ae80a04c76 100755 (executable)
@@ -40,7 +40,7 @@ $tail_html =~ s/SUBSTITUTE_DTIME/$dtime/;
 
 $|=1;
 
-$tpack = lc $status{package};
+$tpack = lc $status{'package'};
 $tpack =~ s/[^-+._a-z0-9()].*$//;
 
 if  ($status{severity} eq 'normal') {
@@ -79,7 +79,7 @@ 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="http://'.$debbugs::gWebDomain.'/ma/l'.&maintencoded($tmaint).'.html">'.&sani($tmaint).'</A>.';
+            '<A href="http://'.$debbugs::gWebDomain.'/db/ma/l'.&maintencoded($tmaint).'.html">'.&sani($tmaint).'</A>.';
 
 my $buglog = buglog($ref, $archive);
 open L, "<$buglog" || &quit("open log for $ref: $!");
@@ -210,8 +210,4 @@ print $tail_html;
 
 print end_html;
 
-sub maintencoded {
-       return "";
-}
-
 exit 0;
index b46f9e2ba1c0e9d1a8d0b90e705322112dced714..47bb36ff8f1536767bfa42396ccf03e5e706aefb 100644 (file)
@@ -9,6 +9,15 @@ sub quit {
        exit 0;
 }
 
+sub abort {
+       my $msg = shift;
+       my $archive = shift;
+       print header . start_html("Sorry");
+       print "Sorry bug #$msg doesn't seem to be in the $archive database.\n";
+       print end_html;
+       exit 0;
+}
+
 sub htmlindexentry {
     my $ref = shift;
        my $archive = shift;
@@ -125,7 +134,10 @@ sub allbugs {
 
 sub pkgbugs {
     my $pkg = shift;
-    open I, "<$debbugs::gSpoolDir/archive/index" || &quit("bugindex: $!");
+       my $archive = shift;
+       if ( $archive ) { open I, "<$debbugs::gSpoolDir/index.archive" || &quit("bugindex: $!"); } 
+       else { open I, "<$debbugs::gSpoolDir/index.db" || &quit("bugindex: $!"); } 
+    
     while(<I>) 
        {       if (/^$pkg\s+(\d+)\s+(.+)/)
                {       
@@ -137,13 +149,30 @@ sub pkgbugs {
 }
 
 sub pkgbugsindex {
-    my $pkg = shift;
+       my $archive = shift;
     my @bugs = ();
-    open I, "<$debbugs::gSpoolDir/archive/index" || &quit("bugindex: $!");
+       if ( $archive ) { open I, "<$debbugs::gSpoolDir/index.archive" || &quit("bugindex: $!"); } 
+       else { open I, "<$debbugs::gSpoolDir/index.db" || &quit("bugindex: $!"); } 
     while(<I>) { $descstr{ $1 } = 1 if (/^(\S+)/); }
     return %descstr;
 }
 
+sub maintencoded {
+    my $input = $_;
+       my $encoded = '';
+
+    while ($input =~ m/\W/) 
+       {       $encoded.=$`.sprintf("-%02x_",unpack("C",$&));
+        $input= $';
+    }
+    $encoded.= $input;
+    $encoded =~ s/-2e_/\./g;
+    $encoded =~ s/^([^,]+)-20_-3c_(.*)-40_(.*)-3e_/$1,$2,$3,/;
+    $encoded =~ s/^(.*)-40_(.*)-20_-28_([^,]+)-29_$/,$1,$2,$3/;
+    $encoded =~ s/-20_/_/g;
+    $encoded =~ s/-([^_]+)_-/-$1/g;
+       return $input;
+}
 sub getmaintainers {
     my %maintainer;
 
@@ -167,9 +196,9 @@ sub getbugstatus {
 
        if ( $archive )
        {       my $archdir = $bugnum % 100;
-               open(S,"$gSpoolDir/archive/$archdir/$bugnum.status" ) || &quit("open $bugnum.status: $!");
+               open(S,"$gSpoolDir/archive/$archdir/$bugnum.status" ) || &abort("$bugnum", "archive" );
        } else
-               { open(S,"$gSpoolDir/db/$bugnum.status") || &quit("open $bugnum.status: $!"); }
+               { open(S,"$gSpoolDir/db/$bugnum.status") || &abort("$bugnum"); }
        my @lines = qw(originator date subject msgid package keywords done
                        forwarded mergedwith severity);
        while(<S>) {
index 5526b7e89e80e60c45ee63da05647fd313c8b4c4..60d8718897eb1af561d646b87523633968955f32 100755 (executable)
@@ -12,8 +12,11 @@ require '/etc/debbugs/config';
 require '/etc/debbugs/text';
 
 my $pkg = param('pkg');
+my $archive = (param('archive') || 'no') eq 'yes';
+my $arc = 'yes';
 
 $pkg = 'ALL' unless defined( $pkg );
+$arc = 'no' unless $archive;
 
 my $repeatmerged = (param('repeatmerged') || 'yes') eq 'yes';
 my $this = "";
@@ -33,8 +36,13 @@ $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( $archive )
+{      print start_html("$debbugs::gProject Archived $debbugs::gBug report logs: package $pkg");
+       print h1("$debbugs::gProject Archived $debbugs::gBug report logs: package $pkg");
+} else
+{      print start_html("$debbugs::gProject $debbugs::gBug report logs: package $pkg");
+       print h1("$debbugs::gProject $debbugs::gBug report logs: package $pkg");
+}
 
 #if (defined $maintainer{$pkg}) {
 #      print "<p>Maintainer for $pkg is <a href=\"" 
@@ -46,16 +54,16 @@ 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);
+{      %strings = pkgbugs($pkg, $archive);
        foreach my $bug ( keys %strings ) 
-       { $this .= "  <LI><A href=\"" . bugurl($bug, "archive=1") . "\">". $strings{ $bug } ."\n"; }
+       { $this .= "  <LI><A href=\"" . bugurl($bug, "archive=$archive") . "\">". $strings{ $bug } ."</A>\n"; }
 } else 
-{      %strings = pkgbugsindex();
+{      %strings = pkgbugsindex( $archive );
        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"; }
+       { $this .= "   <LI><A HREF=\"http://cgi.debian.org/cgi-bin/pkgreport.cgi?pkg=". $bug ."&archive=$arc\">". $bug . "\n"; }
 }
 
 if ( length( $this ) )
index 1f6c40f5143a2c1853d1e44a98256751bb9ad759..c304dcade86f95e7981a25d037e713d623931547 100644 (file)
@@ -1,3 +1,9 @@
+debbugs (2.3-2) unstable; urgency=low
+
+  * Tweeks to the [pkg|bug]report.cgi scripts
+
+ -- Darren Benham <gecko@debian.org>  Tue, 24 Oct 1999 23:16:14 -0700
+
 debbugs (2.3-1) unstable; urgency=low
 
   * Fixed the send message bug that resulted in the same words (subject)
index 88e71a1c25df4a7e58d370b8bbf75dd113ad9c04..f2378fe69b6340d4bdd6a82c260ac5836628d0df 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# $Id: rebuild.in,v 1.1 1999/09/20 05:40:07 gecko Exp $
+# $Id: rebuild.in,v 1.2 1999/10/25 06:18:14 gecko Exp $
 
 # Load modules and set envirnment
 use File::Copy;
@@ -31,12 +31,34 @@ sub readreport {
 $debug = 0;
 defined($startdate= time) || &quit("failed to get time: $!");
 
-open IDXFILE, ">archive/index" or &quit( "trying to reset index file: $!" );
+@ARGV==0 or &quit( "no archive given on the commandline" );
+$archive= shift(@ARGV);
+open IDXFILE, "> index.$archive" or &quit( "trying to reset index file: $!" );
+
+
+if ( $archive eq 'db' )
+{
+       opendir(DIR,'db') || 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;
+    }
+}
+else
+{
 
 #get list of bugs (ie, status files)
 for ($subdir=0; $subdir<100; $subdir++ )
 {
-       my $path = sprintf( "archive/%.2d", $subdir );
+       my $path = sprintf( "$archive/%.2d", $subdir );
        opendir(DIR,$path) || next; 
        @list= grep(m/^\d+\.status$/,readdir(DIR));
        closedir DIR;
@@ -52,4 +74,5 @@ for ($subdir=0; $subdir<100; $subdir++ )
     }
 }
 
+}
 close IDXFILE;