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