1 |
< |
#!/usr/bin/perl |
1 |
> |
#!/usr/bin/perl -w |
2 |
|
|
3 |
< |
print "Content-type: text/html\n\n"; |
3 |
> |
use CGI; |
4 |
> |
$query=new CGI; |
5 |
> |
my($period)=$query->param('period'); |
6 |
> |
$period = "today" unless defined $period; |
7 |
|
|
8 |
< |
my($today) = `date \"+%Y/%m/%d\"`; |
9 |
< |
my($cvs2clpath) = "/home/cut/tdb1/bin/cvs2cl"; |
10 |
< |
my($cvsroot) = "/usr/local/proj/co600_10/cvs"; |
11 |
< |
my($cvs2clargs) = "--stdout -r -b -t -w -U $cvsroot/CVSROOT/users -l \"-d'\>$today'\" -g \"-d$cvsroot\" -g \"-Q\""; |
12 |
< |
my($cmd) = "cd /home/cut/tdb1/cvsscripttemp && $cvs2clpath $cvs2clargs *"; |
8 |
> |
my($firstdate); |
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)"; |
14 |
> |
$days--; |
15 |
> |
$firstdate = `date --date \"$days days ago\" \"+%Y/%m/%d\"`; |
16 |
> |
} |
17 |
> |
elsif($period eq "thisweek") { |
18 |
> |
$firstdate = "last Sunday"; |
19 |
> |
$heading = "i-scream CVS commits this week"; |
20 |
> |
} |
21 |
> |
else { |
22 |
> |
# default to "today only" |
23 |
> |
$firstdate = `/bin/date \"+%Y/%m/%d\"`; |
24 |
> |
$heading = "Today's i-scream CVS commits"; |
25 |
> |
} |
26 |
|
|
27 |
< |
my(@lines) = `$cmd`; |
27 |
> |
my($cvsroot) = "/cvs/i-scream"; |
28 |
|
|
29 |
+ |
my($modulelist)=$query->param('module'); |
30 |
+ |
$modulelist = `ls $cvsroot` unless defined $modulelist; |
31 |
+ |
|
32 |
+ |
my($cvs2clpath) = "/home/sites/www.i-scream.org.uk/bin/cvs2cl.pl"; |
33 |
+ |
my($cvs2clargs) = "--stdout -r -b -t -w -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"; |
36 |
+ |
|
37 |
+ |
print "Content-type: text/html\n\n"; |
38 |
+ |
|
39 |
|
print <<"END"; |
40 |
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
41 |
|
|
42 |
|
<html> |
43 |
|
|
44 |
|
<head> |
45 |
< |
<title>The i-scream Project Logfile Tailer</title> |
20 |
< |
<meta name="description" content="The i-scream Project is a central |
21 |
< |
monitoring system for Unix, Linux and NT servers."> |
22 |
< |
<meta name="keywords" content="i-scream, project, central monitoring |
23 |
< |
system, unix, linux, nt, server, alert"> |
24 |
< |
<meta name="generator" content="notepad on acid, aye."> |
45 |
> |
<title>The i-scream Project Commit Log</title> |
46 |
|
</head> |
47 |
|
|
48 |
< |
<body bgcolor="#ffffff" link="#0000ff" alink="#3333cc" vlink="#3333cc" |
28 |
< |
text="#000066"> |
48 |
> |
<body bgcolor="#ffffff" link="#ffffff" alink="#ffffff" vlink="#ffffff" text="#000066"> |
49 |
|
|
50 |
|
<a href="http://www.i-scream.org.uk"><img border="0" src="../i-scream.gif"></a> |
51 |
|
|
52 |
< |
<h3>Today's i-scream CVS commits</h3> |
52 |
> |
<h2>$heading</h2> |
53 |
|
|
34 |
– |
<a href="cvsweb.cgi">Browse i-scream CVS repository</a> |
35 |
– |
|
36 |
– |
<pre> |
54 |
|
END |
55 |
|
|
56 |
< |
foreach my $line (@lines) { |
57 |
< |
print HTML_encode($line); |
56 |
> |
print `$updatecmd`; |
57 |
> |
|
58 |
> |
my(@modules) = split (/\s+/, $modulelist); |
59 |
> |
|
60 |
> |
foreach my $module (@modules) { |
61 |
> |
|
62 |
> |
print "<table border=\"0\" bgcolor=\"#000066\" cellpadding=\"5\" width=\"100%\">"; |
63 |
> |
print "<tr><td><font size=\"4\"><b><a href=\"/cgi-bin/cvs/viewcvs.cgi/$module\">$module module</a></b></font></td></tr>"; |
64 |
> |
print "<tr><td bgcolor=\"white\">\n"; |
65 |
> |
|
66 |
> |
my(@lines) = `$logcmd $module 2>&1`; |
67 |
> |
if(@lines == 0) { |
68 |
> |
print "There have been no commits in this module during this period.\n"; |
69 |
> |
} |
70 |
> |
else { |
71 |
> |
foreach my $line (@lines) { |
72 |
> |
|
73 |
> |
if ($line =~ /^([0-9]{4}-[0-9]{2}-[0-9]{2}.*?)([^\s]+)$/) { |
74 |
> |
print "<font color=\"blue\"><b>"; |
75 |
> |
print HTML_encode($1); |
76 |
> |
print "</b><i>"; |
77 |
> |
print HTML_encode("by $2"); |
78 |
> |
print "</i></font>" |
79 |
> |
} |
80 |
> |
else { |
81 |
> |
chop $line; |
82 |
> |
print "<code>"; |
83 |
> |
print HTML_encode($line); |
84 |
> |
print "</code><br>" |
85 |
> |
} |
86 |
> |
} |
87 |
> |
} |
88 |
> |
print "</td></tr>\n"; |
89 |
> |
|
90 |
> |
print "</table><p>\n\n"; |
91 |
|
} |
92 |
|
|
93 |
|
print <<"END"; |
94 |
< |
</pre> |
94 |
> |
|
95 |
|
</body> |
96 |
|
|
97 |
|
</html> |
113 |
|
$encoded =~ s/>/>/g; |
114 |
|
return $encoded; |
115 |
|
} |
66 |
– |
|