]> mj.ucw.cz Git - libucw.git/blob - build/cvslog
"not/configured" safe defaults returned to bin/indexer
[libucw.git] / build / cvslog
1 #!/usr/bin/perl
2 # Process `cvs log' output to get a resonable changelog
3 # (c) 2003--2004 Martin Mares <mj@ucw.cz>
4
5 use Digest::MD5;
6 use POSIX;
7
8 my %names= (
9         'mj'            => 'Martin Mares <mj@ucw.cz>',
10         'robert'        => 'Robert Spalek <robert@ucw.cz>',
11         'tom'           => 'Tomas Valla <tom@ucw.cz>',
12         'valla'         => 'Tomas Valla <tom@ucw.cz>',
13         'milan'         => 'Milan Vancura <milan@ucw.cz>',
14         'milanek'       => 'Milan Vancura <milan@ucw.cz>',
15         'tomhol'        => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
16         'centrum'       => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
17         'root'          => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
18         'pavel'         => 'Pavel Machek <pavel@ucw.cz>',
19         'th2'           => 'Tomas Holenda <tomas.holenda@netcentrum.cz>',
20         'croniak'       => 'Vladimir Jelen <vladimir.jelen@netcentrum.cz>',
21 );
22
23 while (<STDIN>) {
24         chomp;
25         /^$/ && next;
26         /^[?]/ && next;
27         /^RCS file: / || die;
28         $_ = <STDIN>;
29         chomp;
30         my ($file) = /^Working file: (.*)$/ or die;
31         #print "$file\n";
32         do {
33                 $_ = <STDIN> or die;
34         } while (!/^description:/);
35         $_ = <STDIN>;
36         for(;;) {
37                 /^======/ && last;
38                 if (/^------/) { $_ = <STDIN>; next; }
39                 /^revision / || die;
40                 $_ = <STDIN>;
41                 my ($author) = /;\s*author:\s*([^;]+)/ or die;
42                 my ($yy,$mm,$dd,$HH,$MM,$SS) = /^date: (....)\/(..)\/(..) (..):(..):(..);/ or die;
43                 my $t = POSIX::mktime($SS,$MM,$HH,$dd,$mm-1,$yy-1900) or die;
44                 my $T = sprintf("%06d", int(($t + 1800)/3600));
45                 $d = "";
46                 while ($_ = <STDIN>) {
47                         /^(-----|=====)/ && last;
48                         $d .= "  $_";
49                 }
50                 my $id = "$T:" . Digest::MD5::md5_hex($d);
51                 if (!defined $msg{$id}) {
52                         $date{$id} = "$yy-$mm-$dd $HH:$MM:$SS";
53                         $msg{$id} = $d;
54                         $files{$id} = "";
55                         $author{$id} = $author;
56                 }
57                 $files{$id} .= "  * $file\n";
58                 #print "\t$id\n";
59         }
60 }
61
62 foreach $id (sort keys %date) {
63         if (!exists ($names{$author{$id}})) {
64                 print STDERR "Unknown commiter $author{$id}\n";
65                 $names{$author{$id}} = "unknown $author{$id}";
66         }
67         print "### ", $date{$id}, "  ", $names{$author{$id}}, "\n\n";
68         print $files{$id}, "\n";
69         print $msg{$id}, "\n";
70 }