5 my($period)=$query->param('period');
6 $period = "today" unless defined $period;
9 if($period eq "days") {
10 my($days)=$query->param('days');
11 $days = 1 unless defined $days;
12 if ($days < 1) {$days = 1};
13 $heading = "i-scream CVS commits in the past $days day(s)";
15 $firstdate = `date --date \"$days days ago\" \"+%Y/%m/%d\"`;
17 elsif($period eq "thisweek") {
18 $firstdate = "last Sunday";
19 $heading = "i-scream CVS commits this week";
22 # default to "today only"
23 $firstdate = `/bin/date \"+%Y/%m/%d\"`;
24 $heading = "Today's i-scream CVS commits";
27 my($cvsroot) = "/cvs/i-scream";
29 my($modulelist)=$query->param('module');
30 $modulelist = `ls $cvsroot` unless defined $modulelist;
32 my($cvs2clpath) = "/home/sites/www.i-scream.org.uk/bin/cvs2cl.pl";
33 my($cvs2clargs) = "--stdout -r -b -t -w -S -U $cvsroot/CVSROOT/users -l \"-d'\>$firstdate'\" -g \"-d$cvsroot\" -g \"-Q\"";
34 my($updatecmd) = "/home/sites/www.i-scream.org.uk/bin/fullcvsupdate.sh $modulelist";
35 my($logcmd) = "cd /home/sites/www.i-scream.org.uk/cvsscripttemp && $cvs2clpath $cvs2clargs";
37 my ($left) = "../left.inc" ;
38 my ($title) = "../title.inc";
39 my ($bottom) = "../bottom.inc";
41 print "Content-type: text/html\n\n";
44 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
49 <title>The i-scream Project Commit Log</title>
52 <body bgcolor="#ffffff" link="#0000ff" alink="#3333cc" vlink="#3333cc" text="#000066">
54 <table border="0" cellpadding="2" cellspacing="2">
74 my(@modules) = split (/\s+/, $modulelist);
76 foreach my $module (@modules) {
78 print "<table border=\"0\" bgcolor=\"#000066\" cellpadding=\"5\" width=\"100%\">\n\n";
79 print "<tr><td>\n<font size=\"4\"><b><a href=\"/cgi-bin/cvs/viewcvs.cgi/$module\" style=\"color: white\">$module module</a></b></font>\n</td></tr>\n\n";
80 print "<tr><td bgcolor=\"white\">\n";
82 my(@lines) = `$logcmd $module 2>&1`;
84 print "There have been no commits in this module during this period.\n";
87 foreach my $line (@lines) {
89 if ($line =~ /^([0-9]{4}-[0-9]{2}-[0-9]{2}.*?)([^\s]+)$/) {
90 print "\n<font color=\"blue\"><b>";
91 print HTML_encode($1);
93 print HTML_encode("by $2");
99 print HTML_encode($line);
100 print "</code><br>\n"
104 print "</td></tr>\n";
106 print "</table><p>\n\n";
109 &print_html($bottom);
124 #------------------------------------------------------
127 # escape HTML characters that may cause problems when
128 # shown either in the <body> or within text fields.
129 #------------------------------------------------------
132 $encoded =~ s/&/&/g;
133 $encoded =~ s/"/"/g;
134 $encoded =~ s/</</g;
135 $encoded =~ s/>/>/g;
139 # Print a file without escaping HTML: -
142 print `cat $filename 2>&1`;