5 my($period)=$query->param('period');
6 $period = "today" unless defined $period;
7 my($modulelist)=$query->param('module');
8 my $moduleext=""; $moduleext=":$modulelist" if defined $modulelist;
11 if($period eq "days") {
12 my($days)=$query->param('days');
13 $days = 1 unless defined $days;
14 if ($days < 1) {$days = 1};
15 $heading = "i-scream CVS$moduleext commits in the past $days day(s)";
17 $firstdate = ">" . `/bin/date -v-${days}d +%Y/%m/%d`;
19 elsif($period eq "date") {
20 my($date)=$query->param('date');
21 $date = `/bin/date +%Y/%m/%d` unless defined $date;
22 $heading = "i-scream CVS$moduleext commits on $date";
23 $firstdate = "$date 00:00<$date 23:59"
25 elsif($period eq "since") {
26 my($date)=$query->param('date');
27 $date = `/bin/date +%Y/%m/%d` unless defined $date;
28 $heading = "i-scream CVS$moduleext commits since $date";
29 $firstdate = ">$date";
31 elsif($period eq "thisweek") {
32 $firstdate = ">last Sunday";
33 $heading = "i-scream CVS$moduleext commits this week";
36 # default to "today only"
37 $firstdate = ">" . `/bin/date +%Y/%m/%d`;
38 $heading = "Today's i-scream CVS$moduleext commits";
41 my($cvsroot) = "/cvs/i-scream";
43 $modulelist = `ls $cvsroot` unless defined $modulelist;
44 $modulelist =~ s/[\r\n]/ /gm;
46 my($cvs2clpath) = "/usr/local/bin/cvs2cl";
47 my($cvs2clargs) = "--stdout --no-wrap --no-common-dir -r -t -w -S -U $cvsroot/CVSROOT/users -l \"-d'$firstdate'\" -g \"-d$cvsroot\" -g \"-Q\"";
48 my($updatecmd) = "/home/iscream/bin/fullcvsupdate.sh $modulelist";
49 my($logcmd) = "cd /tmp/i-scream/cvstmp && $cvs2clpath $cvs2clargs";
51 my ($incdir) = "../htdocs";
54 my ($doctype) = "$incdir/doctype.inc";
55 my ($style) = "$incdir/style.inc";
56 my ($header) = "$incdir/header.inc";
57 my ($footer) = "$incdir/footer.inc";
58 my ($menu) = "$incdir/menu-static.inc" ;
65 # This should be application/xhtml+xml
66 print "Content-type: text/html\n\n";
68 &print_html($doctype);
74 i-scream CVS Commit Logs
94 i-scream CVS Commit Logs
102 print `$updatecmd >/dev/null 2>&1`;
104 my(@modules) = split (/\s+/, $modulelist);
106 foreach my $module (@modules) {
112 <a href="http://cvs.i-scream.org/$module/" class="cvsloghead">$module module</a>
116 my(@lines) = `$logcmd $module 2>&1`;
120 There have been no commits in this module during this period.
126 foreach my $line (@lines) {
128 if ($line =~ /^([0-9]{4}-[0-9]{2}-[0-9]{2}.*?)\s+([^\s]+)(\s+<([^\s]+)>)?$/) {
129 my($datetime) = escapeHTML($1);
130 my($committer) = escapeHTML($2);
133 if($sec != $secwho) {
134 if($sec == $seclog) {
135 @log = &trim_array(@log);
136 foreach my $logline (@log) {
138 print escapeHTML("$logline\n");
149 <div class="logitemfirst">
154 <div class="logitem">
169 <a href="mailto:$email">$committer</a>
181 elsif($line =~ /([^\s]+) (\([^,^\)]+(,[^\)]+)?\))([,:])/) {
182 my ($file, $rev, $tags, $ext) = ($1, $2, $3, $4);
183 $ext = escapeHTML($ext);
184 if($sec != $secfiles) {
190 $file = escapeHTML($file);
192 <a href="http://cvs.i-scream.org/$file">$file</a>
194 if($rev =~ /\(([^\s]+)\.(\d+)(.*)\)/) {
198 my $newrev = "$start.$end";
201 my $oldminver = $end-1;
202 $oldrev = "$start.$oldminver";
204 elsif($start =~ /^((\d+\.)+)(\d+)$/) {
206 # take trailing . off old revision
209 if(defined $oldrev) {
210 my $diff = ".diff?r1=$oldrev&r2=$newrev";
211 my $startend = escapeHTML("$start.$end");
212 $other = escapeHTML($other);
215 (<a href="http://cvs.i-scream.org/$file$diff">$startend</a>$other)$ext
219 $rev = escapeHTML($rev);
226 $rev = escapeHTML($rev);
238 next if $sec == $secwho; # not done secfiles yet
239 if($sec != $seclog) {
250 if($sec == $seclog) {
251 @log = &trim_array(@log);
252 foreach my $logline (@log) {
254 print escapeHTML("$logline\n");
273 &print_html($footer);
291 # Print the contents of a file containing html
294 open(FILE, $filename);
301 # Trim an array (remove beginning and end emptry entries)
304 for(my $i = 0; $i < scalar @array; $i++) {
305 if($array[$i] ne "") {
306 splice @array, 0, $i;
310 for(my $i = scalar @array - 1; $i >= 0; $i--) {
311 if($array[$i] ne "") {