#!/usr/bin/perl
use strict;
use CGI;
my($result, $LIST, $COMMENT, $path, $dir, $line, @sb, %colors, $state, $count);
$result = new CGI();
print $result->header;
$path = "/home/httpd/html/";
$dir = $result->param('dir');
$colors{"Unknown"} = "yellow"; # Unknown state
$colors{"Obsolete"} = "";
$colors{"Ready"} = "6699CC";
$colors{"Included"} = "CC33CC";
$colors{"Included Tweaking"} = "FF9900";
$colors{"Rejected"} = "red";
$colors{"LKML Waiting"} = "000066";
$colors{"LKML Tweaking"} = "FF6600";
$colors{"LKML Accepted"} = "006600";
$colors{"LJML Waiting"} = "000099";
$colors{"LJML Tweaking"} = "FF9900";
$colors{"LJML Accepted"} = "009900";
$colors{"Trivial Waiting"} = "0000CC";
$colors{"Trivial Tweaking"} = "FFCC00";
$colors{"Trivial Accepted"} = "00CC00";
$colors{"Maintainer Waiting"} = "0000FF";
$colors{"Maintainer Tweaking"} = "FFFF00";
$colors{"Maintainer Accepted"} = "00FF00";
print "This page tracks the current status of the patches I have submitted to the linux kernel. It's really for my own reference, but if you want to peruse, then so be it...
\n";
print "
|   | Waiting | Tweaking | Accepted |
| LKML | ".getCount("LKML Waiting")." | ".getCount("LKML Tweaking")." | ".getCount("LKML Accepted")." |
| LJML | ".getCount("LJML Waiting")." | ".getCount("LJML Tweaking")." | ".getCount("LJML Accepted")." |
| Trivial | ".getCount("Trivial Waiting")." | ".getCount("Trivial Tweaking")." | ".getCount("Trivial Accepted")." |
| Maintainer | ".getCount("Maintainer Waiting")." | ".getCount("Maintainer Tweaking")." | ".getCount("Maintainer Accepted")." |
| Obsolete | Rejected | Ready | Included | Unknown |
| ".getCount("Obsolete"). " | ".getCount("Rejected"). " | ".getCount("Ready"). " | ".getCount("Included"). " |   |
| Patch | Modified Date | Status | Comments | |||
| $_ | "; # The creation date of the patch @sb = stat("$path/$dir/$_"); print "".localtime($sb[9])." | "; # Status of the patch if(! -f "$path/$dir/$_-state"){ print "Unknown | "; } else{ $state=`cat $path/$dir/$_-state`; chomp $state; print "$state | "; } if(! -f "$path/$dir/$_-comments"){ print ""; } else{ if(`cat $path/$dir/$_-comments | wc -l | tr -d " "` > 6){ print " | Comments | \n"; } else{ print "";
open COMMENT, "< $path/$dir/$_-comments";
while( $1"; } s/@/ [at] /g; s/From:(.*)/From:$1<\/i> /g; s/^[ \t]*$/ /g; s/<pre>/ /g; s/<\/pre>/<\/pre>/g; print $_; } print " | ";
close COMMENT;
}
}
print "