#!/usr/gnu/bin/perl # wwwgnats.pl - a WWW interface to the GNATS bug tracking system # Thanks to Larry Wall, CERN, and NCSA for Perl, WWW, and Mosaic! # Configuration begins here $GNATSADM = "/usr/gnu/lib/gnats/gnats-db/gnats-adm"; $GNATSBIN = "/usr/gnu/bin"; # Configuration ends here # Modification log: # 7/14/94 Dan Kegel (dank@adventure.com) - Originally written # 7/15/94 Huy Le - Added loop over restrictions # 7/16/94 Dan Kegel - added config section & read responsible file # End Modifcation log sub dumpenv { print "
\n";
foreach (sort(keys(%ENV))) {
print "$_ ", $ENV{$_}, "\n";
}
print "\n";
}
sub readarrays {
# category tag : category name : responsible : other-interested-people
# ace-bitmap:Accomplish Bitmap Dwg:sr:dank
open(CATEG, "<$GNATSADM/categories") ||
die "Couln't get categories file\n";
while (query-pr -i $opts\n\n"; open(PIPE,"$GNATSBIN/query-pr -i $opts|") || die "Can't open"; @prs =
\n";
# Print field headers.
local($OUTFORM, $WIDTH, $fstring, $str);
$fstring = "";
foreach (@info) {
($OUTFORM, $WIDTH)=split(/:/,$info{$_});
if ($OUTFORM <= $outform) {
$fstring .= &truncstr($_, $WIDTH) . " ";
}
}
print " ",$fstring,"\n";
# Print each SPR in result as link to full text
foreach (@prs) {
s/\s*\|\s*/|/go;
( $NUMBER,
$CATEGORY,
$SYNOPSIS,
$CONFIDENTIAL,
$SEVERITY,
$PRIORITY,
$RESPONSIBLE,
$STATE,
$CLASS,
$SUBMITTER,
$ARRIVAL_DATE,
$ORIGINATOR,
$RELEASE ) = split(/\|/, $_);
$SEVERITY = $outSeverity[$SEVERITY];
$PRIORITY = $outPriority[$PRIORITY];
$STATE = $nState[$STATE];
$CLASS = $nClass[$CLASS];
$fstring = sprintf("%s", substr(" ", 0, (length($NUMBER<4))?3-length("$NUMBER"):1));
# @info is an array of the variable names $NUMBER, etc., in presentation order.
# %info tells which outform level and ?below? to print this variable in,
# and how wide to print it.
foreach (@info) {
($OUTFORM, $WIDTH)=split(/:/,$info{$_});
if ($OUTFORM <= $outform) {
$str = eval "\$$_";
$fstring .= &truncstr($str, $WIDTH) . " ";
}
}
print "$NUMBER ",$fstring,"\n";
}
print "\n";
}
sub query_full
{
local($spr) = $_[0];
local(@pr);
# Read in full text of given pr
print "\n";
print @pr;
print "\n";
}
sub main_menu
{
print "\n"; # Get all restrictions. First, strip off outform prefix. ($RESTR = $QUERY_STRING) =~ s/^outform=\w+&//; # Then, split into words. @RESTR=split(/&/,$RESTR); #print "@RESTR\n"; # Were we invoked as /full? if ($PATH_INFO =~ /^\/full\//) { local($subdir); $subdir = $PATH_INFO; $subdir =~ s,^\/full\/,,; &query_full($subdir); } elsif ($PATH_INFO =~ /^\/quick/) { &query_quick($OUTFORM,@RESTR); } elsif ($PATH_INFO eq "") { &main_menu(); } else { print "