/[perl]/rcs2html.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /rcs2html.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Sun Oct 26 14:24:32 2003 UTC (16 years, 1 month ago) by dpavlin
Branch: MAIN
File MIME type: text/plain
format rcs2log output to html

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

  ViewVC Help
Powered by ViewVC 1.1.26