1 |
#!/usr/bin/perl -w |
2 |
|
3 |
use strict; |
4 |
|
5 |
my $rcs2log = "rcs2log ".join(" ",@ARGV); |
6 |
my $have_ul = 0; |
7 |
|
8 |
sub encode { |
9 |
my $foo = shift; |
10 |
$foo =~ s/</</g; |
11 |
$foo =~ s/>/>/g; |
12 |
$foo =~ s/"/"/g; |
13 |
return $foo; |
14 |
} |
15 |
|
16 |
|
17 |
open(RCS2LOG, "$rcs2log |") || die "$rcs2log: $!"; |
18 |
while(<RCS2LOG>) { |
19 |
chomp; |
20 |
next if (/^$/); |
21 |
if (/^(\d\d\d\d-\d+-\d+)\s+(.+)\s(<.+>)$/) { |
22 |
my ($date,$who,$email) = ($1,$2,$3); |
23 |
if ($have_ul) { |
24 |
print "</ul>\n"; |
25 |
$have_ul = 0; |
26 |
} |
27 |
$email = encode($email); |
28 |
$email =~ s/@/(at)/g; |
29 |
$email =~ s/\./(dot)/g; |
30 |
print "<tt>$date</tt> $who <tt>$email</tt>\n"; |
31 |
} elsif (/^\t\* ([^:]+):(\s*.*)$/) { |
32 |
if (! $have_ul) { |
33 |
print "<ul>\n"; |
34 |
$have_ul = 1; |
35 |
} |
36 |
print "<li> <tt>$1</tt>:".encode($2)."\n"; |
37 |
} elsif (/^\t([-]\s.*)$/) { |
38 |
print "<br>".encode($1)."\n"; |
39 |
} else { |
40 |
print encode($_)."\n"; |
41 |
} |
42 |
} |
43 |
|