#! /usr/bin/perl
#
# This script is used to create a web version of the file
# gno/NOTES/status.bin.
#
# Usage: mkstatus infile outfile.html
#
# $Id: mkstatus,v 1.3 2012/08/25 07:22:00 gdr Exp $
#
# check usage and open files
if (scalar(@ARGV) != 2) {
printf(stderr "usage: mkstatus infile outfile");
exit(1);
}
$infile = shift;
$outfile = shift;
open(infp, "< $infile") || &Fatal("couldn't open $infile for input: $?");
open(outfp, "> $outfile") || &Fatal("couldn't open $outfile for output: $?");
# Initialize the months strings.
push(@month,
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
"Oct", "Nov", "Dec" );
# print out the html header
printf(outfp
"\n" .
"
\n" .
") {
if (/\$Id([^\$]*)\$/) {
$_ = $1;
if (/^:\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+/) {
$file=$1;
$version=$2;
$rawdate=$3;
$time=$4;
if ($rawdate =~ m,(\d+)/(\d+)/(\d+),) {
$year = $1;
$m = $2;
$day = $3;
$mon = @month[int($2) - 1];
$date = "$day $mon $year";
}
} else {
$date = "(unspecified date)";
}
last;
}
}
# initial information
printf(outfp
"GNO Program Status List
\n".
"Last Updated: %s\n" .
"This page shows the current status of various program components.
".
"Unfortunately, this page does not show it's tables very well\n".
"when viewing with lynx, so you're better off using a graphical\n".
"browser. My apologies to those who do not have this option.
\n",
$date);
printf(outfp
"
Field Descriptions
\n".
"Each program listed below has associated with it a number of\n".
"columns. The meaning of each column is listed below. Empty\n".
"entries indicate incomplete programs or unavailable information.\n".
"Hyphens (-) indicate that the field is not relevent.\n".
"
\n".
"- Program Name\n".
"This is the pathname of the program or component. Where it is part\n".
"of a package, the name of the package appears on parenthesis.\n".
"
- 204\n".
"This column indicates whether or not the component was part of\n".
"GNO v2.0.4.\n".
"
- Req\n".
"This column indicates whether or not the component is initially\n".
"deemed necessary in GNO v2.0.6\n".
"
- Owner\n".
"This lists who is responsible for updating the component.\n".
"A an explanation of the identifiers follows this table.\n".
"
- Src\n".
"Has the source been located or written? A dir indicates\n".
"that the file is a directory.\n".
"
- Doc\n".
"Is the documentation complete? This includes the manual page in\n".
"nroff format, the describe entry, the rVersion source, and any\n".
"required auxillary documentation.\n".
"A P indicates that the documentation is present.\n".
"A T indicates that it's been tested (reviewed).\n".
"A [G] indicates that the BSD manual page is present, but\n".
"that a GNO-formatted manual page is still missing.\n".
"
- Cmpl\n".
"Does the program compile cleanly with the new headers/libraries?\n".
"
- Test\n".
"Has the program passed at least rudimentary testing?\n".
"
- Arc\n".
"(Archived.) Have the sources been entered into the cvs repository?\n".
"
- Install\n".
"Are the release (R) and install (I) targets complete?\n".
"The release target places the finished program, its documentation\n".
"and associated files into the /dist hierarchy (which is present on\n".
"developmental systems). The install target places the files into\n".
"the currently running system. The /dist hierarchy later becomes\n".
"the basis for the distribution.\n".
"
- Comments\n".
"This is any extra information.\n".
"
\n");
printf(outfp
"If you would like to work on a given utility, make sure you pick\n".
"one that has not already been claimed. Before starting, you should\n".
"then contact ".'Devin Reade '.
"to ensure your name gets on the list. This should eliminate\n".
"duplicated work
\n");
# search for the start of the participants list
$found = 0;
while () {
if (/^\s*%%%NAMES-START%%%\s*$/) {
$found = 1;
last;
}
}
($found) || &Fatal("start of names table not found");
while() {
(/^\s*%%%NAMES-END%%%\s*$/) && last;
s/\(.*//; # dump comments
if (/\s*(\S+)\s*([^<]+)\s*<([^>]+)/) {
$names{$1} = $2;
$email{$1} = $3;
}
}
# start the table
printf(outfp
'' ."\n" .
"Program Name\n" .
" | 204\n" .
" | Req\n" .
" | Owner\n" .
" | Src\n" .
" | Man\n" .
" | Cmpl\n" .
" | Test\n" .
" | Arc\n" .
" | Install\n" .
" | Comments\n");
# debug
# printf(outfp "\n");
# search for the start of the status table
$found = 0;
while () {
if (/^\s*%%%STATUS-TABLE-START%%%\s*$/) {
$found = 1;
last;
}
}
($found) || &Fatal("start of status table not found");
# extract the status info
while () {
(/^\s*%%%STATUS-TABLE-END%%%\s*$/) && last; # end of table
if (/\#\s*(.*)/) {
$comment = $1;
$_ = $`;
} else {
$comment = '';
}
($prog, $in204, $req, $owner, $source, $man, $compile, $test,
$archive, $install, $pkgNote) = split;
# leave out the package. Merge notes in with name.
if ($pkgNote =~ /\[([^\]]+)\]/) {
$note = $1;
} else {
$note = '';
}
if ($pkgNote =~ /\(([^\)]+)\)/) {
$prog .= " ($1)";
}
$prog = &htmlconv($prog);
$in204 = &htmlconv($in204);
$req = &htmlconv($req);
$owner = &htmlconv($owner);
$source = &htmlconv($source);
$man = &htmlconv($man);
$compile = &htmlconv($compile);
$test = &htmlconv($test);
$archive = &htmlconv($archive);
$install = &htmlconv($install);
# $pkgNote = &htmlconv($pkgNote);
$comment = &htmlconv($comment);
if ($note ne '') {
$prog .= ' [Note '.$note.']';
}
printf(outfp
"\n" .
"%s" .
" | %s" .
" | %s" .
" | %s" .
" | %s" .
" | %s" .
" | %s" .
" | %s" .
" | %s" .
" | %s" .
" | %s" .
" | %s\n",
$prog, $in204, $req, $owner, $source, $man, $compile, $test,
$archive, $install, $comment);
}
# end the table
printf(outfp " | |
\n");
# search for any notes
$printed = 0;
while() {
if (/%%%NOTE-START-([^%]+)%%%/) {
if ($printed == 0) {
$printed = 1;
printf(outfp "Notes
\n");
}
printf(outfp
'Note '.$1.":\n");
while() {
(/%%%NOTE-END-([^%]+)%%%/) && last;
print outfp &htmlconv($_)
}
printf(outfp "\n");
}
}
# print out the list of participants
printf(outfp
"Contributers
\n".
"The following table shows the names for the "Owner"\n".
"column of the status table, above:\n" .
'' ."\n".
"ID | Name | | ID | Name | | ID | Name\n");
@keylist = keys(%names);
@keylist = sort(@keylist);
$column = 0;
$columns = 3;
foreach $k (@keylist) {
if (($column % $columns) == 0) {
printf(outfp " |
");
} else {
printf(outfp " ");
}
$column++;
if ($email{$k} eq 'none') {
printf(outfp " | %s | %s\n", $k, $names{$k});
} else {
printf(outfp
" | %s".
' | %s'."\n",
$k, $email{$k}, $names{$k});
}
}
# pad the last of the table
while (($column % $columns) != 0) {
printf(outfp " | | | \n");
$column++;
}
printf(outfp " |
");
# print out the html footer
printf(outfp
"
\n" .
"Devin Reade\n" .
"
\n" .
'gdr@gno.org' ."\n".
"\n");
# clean up and exit
close(infp);
close(outfp);
sub htmlconv {
local($text);
$text = @_[0];
if (($text eq '.') || ($text eq '')) {
$text = ' ';
} else {
$text =~ s/<\;/g;
$text =~ s/>/>\;/g;
$text =~ s/"/"\;/g;
}
return $text;
}
sub Fatal {
print stderr "Fatal Error: ";
print stderr @_;
print stderr "\nAborted\n";
exit(1);
}